Documentation ¶
Overview ¶
Package logger supports multiple levels of logging. Users can enable or disable log levels using the "log" environment variable. By default, logger logs **info** and **error** levle logs. Custom log levels can be added anytime as required.
Index ¶
- func Debug(logs ...interface{})
- func Disable(lvl string)
- func Enable(lvl string)
- func Error(err error, logs ...interface{})
- func Info(logs ...interface{})
- func Print(lvl string, logs ...interface{})
- func Time(beg time.Time, min time.Duration, logs ...interface{})
- type Logger
- func (l *Logger) Debug(logs ...interface{})
- func (l *Logger) Error(err error, logs ...interface{})
- func (l *Logger) Info(logs ...interface{})
- func (l *Logger) New(head string) *Logger
- func (l *Logger) Print(lvl string, logs ...interface{})
- func (l *Logger) Time(beg time.Time, min time.Duration, logs ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Error ¶
func Error(err error, logs ...interface{})
Error prints error logs using the default logger
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a logger with a header
func (*Logger) Debug ¶
func (l *Logger) Debug(logs ...interface{})
Debug logs lots of details useful for debugging
func (*Logger) Info ¶
func (l *Logger) Info(logs ...interface{})
Info prints basic information to stdout
Click to show internal directories.
Click to hide internal directories.