Documentation
¶
Index ¶
- type Logger
- func (l *Logger) Debug(msg string)
- func (l *Logger) Error(msg string)
- func (l *Logger) Info(msg string)
- func (l *Logger) Warn(msg string)
- func (l *Logger) WithConsoleOutput(want bool) *Logger
- func (l *Logger) WithDebug(want bool) *Logger
- func (l *Logger) WithDirectory(dir string) *Logger
- func (l *Logger) WithName(name string) *Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a wrapper around zerolog and options
func NewLogger ¶
func NewLogger() *Logger
Creates a new logger with default settings:
dir: "./logs"
name: "app"
wantConsoleOutput: false
wantFileOutput: true
func (*Logger) Debug ¶
Prints a debug message to log output if level is debug
May also print to os.Stdout if logger was created with WithConsoleOutput()
func (*Logger) Error ¶
Prints an error message to log output
May also print to os.Stderr if logger was created with WithConsoleOutput()
func (*Logger) Info ¶
Prints an info message to log output
May also print to os.Stdout if logger was created with WithConsoleOutput()
func (*Logger) Warn ¶
Prints a warning message to log output
May also print to os.Stdout if logger was created with WithConsoleOutput()
func (*Logger) WithConsoleOutput ¶
Modifies logger to also print to console (just fmt no json)
func (*Logger) WithDirectory ¶
Modifies logger to use a custom directory for log file