// NewWithLog creates tango with the special logger and handlers
199275
func NewWithLog(logger Logger, handlers ...Handler) *Tango {
	tan := &Tango{
		Router:     newRouter(),
		logger:     logger,
		handlers:   make([]Handler, 0),
		ErrHandler: Errors(),
	}

	tan.ctxPool.New = func() interface{} {
		return &Context{
			tan:    tan,
			Logger: tan.logger,
		}
	}

	tan.respPool.New = func() interface{} {
		return &responseWriter{}
	}

	tan.Use(handlers...)

	return tan
}
588160
func New(out io.Writer, flags FlagSet) *Logger {
	return NewFormatLogger(out, flags, &FormatWriterStructured{})
}
742473
func (cl *CoLog) NewLogger() *log.Logger {
	cl.mu.Lock()
	defer cl.mu.Unlock()

	return log.New(cl, "", 0)
}
513552
func New(handler Handler, flag int) *Logger {
	var l = new(Logger)

	l.level = LevelInfo
	l.handler = handler

	l.flag = flag

	l.quit = make(chan struct{})
	l.closed = false

	l.msg = make(chan []byte, 1024)

	l.bufs = make([][]byte, 0, 16)

	l.wg.Add(1)
	go l.run()

	return l
}
947583
func New(out io.Writer, prefix string, flags int) *log.Logger {
	return NewLogger(prefix, flags, NewHandler(out))
}
939643
func NewListenerWith(logger *events.Logger, listener net.Listener) net.Listener {
	return &listenerLogger{
		Listener: listener,
		Logger:   logger,
	}
}
58776
func New(l *log.Logger, ll Level) Logger {
	return &logger{
		Logger:   l,
		Level:    ll,
		ctxPairs: []interface{}{},
	}
}
593916
func New(na ...string) (log Logger) {
	s := strings.Join(na, DefaultSepperator)
	return Logger(s)
}
770206
func NewContextWithLogger(ctx context.Context, log *zap.Logger) context.Context {
	return context.WithValue(ctx, loggerKey, log)
}
937294
func New(info logger.Info) (logger.Logger, error) {
	if info.LogPath == "" {
		return nil, errdefs.System(errors.New("log path is missing -- this is a bug and should not happen"))
	}

	cfg := newDefaultConfig()
	if capacity, ok := info.Config["max-size"]; ok {
		var err error
		cfg.MaxFileSize, err = units.FromHumanSize(capacity)
		if err != nil {
			return nil, errdefs.InvalidParameter(errors.Wrapf(err, "invalid value for max-size: %s", capacity))
		}
	}

	if userMaxFileCount, ok := info.Config["max-file"]; ok {
		var err error
		cfg.MaxFileCount, err = strconv.Atoi(userMaxFileCount)
		if err != nil {
			return nil, errdefs.InvalidParameter(errors.Wrapf(err, "invalid value for max-file: %s", userMaxFileCount))
		}
	}

	if userCompress, ok := info.Config["compress"]; ok {
		compressLogs, err := strconv.ParseBool(userCompress)
		if err != nil {
			return nil, errdefs.InvalidParameter(errors.Wrap(err, "error reading compress log option"))
		}
		cfg.DisableCompression = !compressLogs
	}
	return newDriver(info.LogPath, cfg)
}
536453
func NewLogger() *Logger {
	logger := &Logger{*log.New(os.Stdout, "", log.LstdFlags), false, false}
	return logger
}
1319802
func NewLoggerWithFormatter(level string, formatter logrus.Formatter) (*logrus.Logger, error) {
	logger := logrus.New()
	// If there is an environment override, use that
	envLogLevel := os.Getenv(envVarLogLevel)
	if envLogLevel != "" {
		level = envLogLevel
	}

	logLevel, err := logrus.ParseLevel(level)
	if err != nil {
		return nil, err
	}

	logger.Level = logLevel
	if nil != formatter {
		logger.Formatter = formatter
	}
	logger.Out = os.Stdout
	return logger, nil
}
426427
func NewLogger(handler Handler) *Logger {
	return &Logger{
		Handler:      handler,
		EnableSource: true,
		EnableDebug:  true,
	}
}
165670
func New(logger std.Logger, debug bool) *Logger {
	l := &Logger{
		Debug:  debug,
		Logger: logger,
	}

	if l.Logger == nil {
		l.Logger = log.New(os.Stderr, "", log.LstdFlags)
	}

	return l
}
298934
func (l *Logger) With(args Args) *Logger {
	var newArgs Args
	var newLen = len(l.Args) + len(args)

	if newLen != 0 {
		newArgs = make(Args, 0, newLen)
		newArgs = append(newArgs, l.Args...)
		newArgs = append(newArgs, args...)
	}

	return &Logger{
		Args:         newArgs,
		Handler:      l.Handler,
		EnableSource: l.EnableSource,
		EnableDebug:  l.EnableDebug,
	}
}
212179
func New(key string, flow FlowType, message string) *PersistentLog {
	return &PersistentLog{
		Timestamp: time.Now(),
		Flow:      flow,
		Key:       key,
		Message:   message,
	}
}
1128290
func (l LoggerStruct) NewLogger() LoggerStruct {
	new := LoggerStruct{}
	new.logger = l.logger.New()
	new.handler = l.handler
	new.inDebug = l.inDebug
	new.processPid = l.processPid

	return new
}