// NewPlainLogger returns a configured sender that has no prefix and
// uses a plain formatter for messages, using only the string format
// for each message. This sender writes all output to standard output.
16971
func NewPlainLogger(name string, l LevelInfo) (Sender, error) {
	return setup(MakePlainLogger(), name, l)
}
1290521
func NewLogWriter(buf int) *LogWriter {
	return &LogWriter{
		logs:     make([]string, buf),
		index:    0,
		handlers: make(map[LogHandler]struct{}),
	}
}
597376
func NewDefaultLogger() Logger {
	return &defaultLogger{
		logger: log.New(os.Stdout, "", log.LstdFlags),
	}
}
588160
func New(out io.Writer, flags FlagSet) *Logger {
	return NewFormatLogger(out, flags, &FormatWriterStructured{})
}
58776
func New(l *log.Logger, ll Level) Logger {
	return &logger{
		Logger:   l,
		Level:    ll,
		ctxPairs: []interface{}{},
	}
}
947583
func New(out io.Writer, prefix string, flags int) *log.Logger {
	return NewLogger(prefix, flags, NewHandler(out))
}
354924
func NewLogger(out io.Writer) Logger {
	l := log.New(out, "[tango] ", log.Ldefault())
	l.SetOutputLevel(log.Ldebug)
	return l
}
193983
func NewParentLogger(name string, factory LoggerFactory) *ParentLogger {
	return &ParentLogger{
		Logger:  factory.NewLogger(name),
		Prefix:  name,
		Factory: factory,
	}
}
614714
func NewLogHelper(v ...interface{}) (*LogHelper, error) {
	mask := os.O_APPEND | os.O_RDWR | os.O_CREATE
	mylog := LogHelper{}

	// use stdout & stderr
	if len(v) == 0 {
		mylog.Logger[0] = log.New(os.Stdout, "TRACE - ", FLAGS)
		mylog.Logger[1] = log.New(os.Stderr, "ERROR - ", FLAGS)
		return &mylog, nil
	}
	fileName := v[0].(string)
	// app.log & app.log.error
	mylog.LogFileNames = [2]string{fileName, fileName + ".error"}
	// check dir wether exist and mkdir
	if _, err := os.Stat(path.Dir(mylog.LogFileNames[0])); err != nil {
		os.Mkdir(path.Dir(mylog.LogFileNames[0]), 0777)
	}

	if logFile, err := os.OpenFile(mylog.LogFileNames[0], mask, 0666); err == nil {
		mylog.Logger[0] = log.New(logFile, "TRACE - ", FLAGS)
		mylog.Logger[0].Flags()
	} else {
		return nil, err
	}

	if logFile, err := os.OpenFile(mylog.LogFileNames[1], mask, 0666); err == nil {
		mylog.Logger[1] = log.New(logFile, "ERROR - ", FLAGS)
	} else {
		return nil, err
	}
	return &mylog, nil
}
1066106
func NewLogger(component string, options ...zap.Option) Logger {
	enc := zap.NewJSONEncoder(
		zap.LevelString("log_level"),
		zap.MessageKey("message"),
		zap.EpochFormatter("timestamp"),
		numberLevelFormatter(),
	)
	origLogger := zap.New(enc, options...)

	return &logger{
		source:     component,
		origLogger: origLogger,
		Logger:     origLogger.With(zap.String("source", component)),
	}
}
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)
}
965148
func NewRootLogger(level LogLevelType) *RootLogger {
	logger := NewStandardLogger("root", level)
	logger.SetPropagate(false)
	return &RootLogger{
		StandardLogger: logger,
	}
}
1303020
func NewLogger(logger zerolog.Logger) *Logger {
	return &Logger{
		logger: logger.With().Str("module", "pgx").Logger(),
	}
}
1313329
func NewErrorLogger(name string, l LevelInfo) (Sender, error) {
	return setup(MakeErrorLogger(), name, l)
}
107298
func NewNFLogger(ipv4groupSource, ipv4groupDest uint16, getPUInfo GetPUInfoFunc, collector collector.EventCollector) NFLogger {
	return &nfLog{}
}
94684
func NewLogger(outputLogger log.Logger) *Logger {
	// We will never halt the progress of a log emitter. If log output takes too
	// long will start dropping log lines by using a ring buffer.
	swapLogger := new(log.SwapLogger)
	swapLogger.Swap(outputLogger)
	return &Logger{
		Output: swapLogger,
		// logging contexts
		Info: log.With(swapLogger,
			structure.ChannelKey, structure.InfoChannelName,
		),
		Trace: log.With(swapLogger,
			structure.ChannelKey, structure.TraceChannelName,
		),
	}
}
1290395
func (p *ParentLogger) NewLogger(name string) Logger {
	factory := p.Factory
	if factory == nil {
		factory = DefaultRegistry
	}
	return factory.NewLogger(fmt.Sprintf("%s.%s", p.Prefix, name))
}