// NewLogger allocates and returns a new logger which sends events to handler.
426427
func NewLogger(handler Handler) *Logger {
	return &Logger{
		Handler:      handler,
		EnableSource: true,
		EnableDebug:  true,
	}
}
1292107
func newLogger(w zapcore.WriteSyncer) *zap.Logger {
	conf := Config()
	enc := zapcore.NewConsoleEncoder(conf)
	core := zapcore.NewCore(enc, w, Level)

	return zap.New(core)
}
414116
func NewLogger(stdout, stderr io.Writer, debug bool) *Logger {
	return &Logger{stdout: stdout, stderr: stderr, debug: debug}
}
960511
func newLogger(c *Context) (log15.Logger, error) {
	lvl := c.String(FlagLogLevel)
	l := log15.New()
	log.Println(fmt.Sprintf("Using log level %s", lvl))
	v, err := log15.LvlFromString(lvl)
	if err != nil {
		return l, err
	}
	h := log15.LvlFilterHandler(v, log15.StreamHandler(os.Stdout, log15.LogfmtFormat()))
	if lvl == "debug" {
		h = log15.CallerFileHandler(h)
	}
	l.SetHandler(log15.LazyHandler(h))
	return l, err
}
366061
func NewLogger(level string) *Logger {
	log := kitlog.NewJSONLogger(kitlog.NewSyncWriter(os.Stdout))
	switch level {
	case "error":
		log = kitlevel.NewFilter(log, kitlevel.AllowError()) // only error logs
	case "warn":
		log = kitlevel.NewFilter(log, kitlevel.AllowWarn()) // warn + error logs
	case "info":
		log = kitlevel.NewFilter(log, kitlevel.AllowInfo()) // info + warn + error logs
	case "debug":
		log = kitlevel.NewFilter(log, kitlevel.AllowDebug()) // all logs
	default:
		log = kitlevel.NewFilter(log, kitlevel.AllowNone()) // no logs
	}

	log = kitlog.With(log, "service", "vent")
	log = kitlog.With(log, "ts", kitlog.DefaultTimestampUTC)
	log = kitlog.With(log, "caller", kitlog.Caller(4))

	return &Logger{
		Log: log,
	}
}
82895
func NewLoginUser(ctx *middleware.Context, handler LoginUserHandler) *LoginUser {
	return &LoginUser{Context: ctx, Handler: handler}
}
932227
func (s *Logging) Logger(name string) *FabricLogger {
	zl := s.ZapLogger(name)
	return NewFabricLogger(zl)
}
943567
func NewLogger(sink io.Writer, options ...Option) *Logger {
	if sink == nil {
		sink = ioutil.Discard
	}

	l := &Logger{
		sink:     sink,
		throttle: DefaultLoggingThrottle,
		widthFn: func() int {
			size, err := ts.GetSize()
			if err != nil {
				return 80
			}
			return size.Col()
		},
		queue: make(chan Task),
		tasks: make(chan Task),
		wg:    new(sync.WaitGroup),
	}

	for _, option := range options {
		option(l)
	}

	l.tty = tty(sink)

	go l.consume()

	return l
}
163529
func NewLogger(component string) *TestLogger {
	buf := gbytes.NewBuffer()
	log := lager.NewLogger(component)
	log.RegisterSink(lager.NewWriterSink(buf, lager.DEBUG))
	return &TestLogger{log, buf}
}
209867
func NewRingLogger(driver Logger, logInfo Info, maxSize int64) Logger {
	if maxSize < 0 {
		maxSize = defaultRingMaxSize
	}
	l := newRingLogger(driver, logInfo, maxSize)
	if _, ok := driver.(LogReader); ok {
		return &ringWithReader{l}
	}
	return l
}
500724
func (lr *logRegistry) NewLogger(name string) logging.Logger {
	if existingLogger := lr.getLoggerFromMapping(name); existingLogger != nil {
		panic(fmt.Errorf("logger with name '%s' already exists", name))
	}
	if err := checkLoggerName(name); err != nil {
		panic(err)
	}

	logger := NewLogger(name)

	// set initial logger level
	if lvl, ok := lr.logLevels[name]; ok {
		setLevel(logger, lvl)
	} else {
		setLevel(logger, lr.defaultLevel)
	}

	lr.putLoggerToMapping(logger)

	// add all defined hooks
	for _, hook := range lr.hooks {
		logger.std.AddHook(hook)
	}

	return logger
}
22614
func NewLogger(stdoutThreshold, logThreshold jww.Threshold, outHandle, logHandle io.Writer, saveErrors bool) *Logger {
	return newLogger(stdoutThreshold, logThreshold, outHandle, logHandle, saveErrors)
}
1348687
func NewChannelLogger(size int, onFull Logger) *ChannelLogger {
	return &ChannelLogger{
		Out:    make(chan []interface{}, size),
		Err:    make(chan error, size),
		OnFull: onFull,
	}
}
710844
func NewWriteLogger(prefix string, w io.Writer) io.Writer {
	return &writeLogger{prefix, w}
}
536453
func NewLogger() *Logger {
	logger := &Logger{*log.New(os.Stdout, "", log.LstdFlags), false, false}
	return logger
}
23483
func NewLogger() dlog.Logger {
	return dlog.NewLogger(
		glog.Infoln,
		map[dlog.Level]func(...interface{}){
			dlog.LevelDebug: glog.Infoln,
			dlog.LevelInfo:  glog.Infoln,
			dlog.LevelWarn:  glog.Warningln,
			dlog.LevelError: glog.Errorln,
			// this relies on implementation-specific details of the generic dlog Logger implementation, not good
			dlog.LevelFatal: glog.Fatalln,
			dlog.LevelPanic: glog.Errorln,
		},
	)
}
738655
func NewLogger(w io.Writer, newLogger func(io.Writer) log.Logger, color func(keyvals ...interface{}) FgBgColor) log.Logger {
	if !IsTerminal(w) {
		return newLogger(w)
	}
	return NewColorLogger(NewColorWriter(w), newLogger, color)
}