New Creates a new logger. Configuration should be set by changing [Formatter], Out and Hooks directly on the default Logger instance. You can also just instantiate your own: var log = &logrus.Logger{ Out: os.Stderr, Formatter: new(logrus.TextFormatter), Hooks: make(logrus.LevelH
()
| 85 | // |
| 86 | // It's recommended to make this a global instance called `log`. |
| 87 | func New() *Logger { |
| 88 | return &Logger{ |
| 89 | Out: os.Stderr, |
| 90 | Formatter: new(TextFormatter), |
| 91 | Hooks: make(LevelHooks), |
| 92 | Level: InfoLevel, |
| 93 | ExitFunc: os.Exit, |
| 94 | ReportCaller: false, |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | func (logger *Logger) newEntry() *Entry { |
| 99 | entry, ok := logger.entryPool.Get().(*Entry) |
no outgoing calls