Documentation ¶
Index ¶
- type CustomLogger
- type LogLevel
- type Logger
- func (l *Logger) CustomLogger(name string) CustomLogger
- func (l *Logger) Debug(format string, args ...interface{})
- func (l *Logger) Error(format string, args ...interface{})
- func (l *Logger) Fatal(format string, args ...interface{})
- func (l *Logger) HideLogLevel()
- func (l *Logger) Info(format string, args ...interface{})
- func (l *Logger) Print(message string)
- func (l *Logger) SetLogLevel(level LogLevel)
- func (l *Logger) Trace(format string, args ...interface{})
- func (l *Logger) Warning(format string, args ...interface{})
- func (l *Logger) Write(message string)
- func (l *Logger) Writeln(message string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomLogger ¶
type CustomLogger interface { // Writeln writes directly to the output with no log level plus line ending Writeln(message string) // Write writes directly to the output with no log level Write(message string) // Trace level logging. Works like Sprintf. Trace(format string, args ...interface{}) // Debug level logging. Works like Sprintf. Debug(format string, args ...interface{}) // Info level logging. Works like Sprintf. Info(format string, args ...interface{}) // Warning level logging. Works like Sprintf. Warning(format string, args ...interface{}) // Error level logging. Works like Sprintf. Error(format string, args ...interface{}) // Fatal level logging. Works like Sprintf. Fatal(format string, args ...interface{}) }
CustomLogger defines what a user can do with a logger
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a utlility to log messages to a number of destinations
func New ¶
New creates a new Logger. You may pass in a number of `io.Writer`s that are the targets for the logs
func (*Logger) CustomLogger ¶
func (l *Logger) CustomLogger(name string) CustomLogger
CustomLogger creates a new custom logger that prints out a name/id before the messages
func (*Logger) HideLogLevel ¶
func (l *Logger) HideLogLevel()
HideLogLevel removes the loglevel text from the start of each logged line
func (*Logger) Print ¶
Print writes directly to the output with no log level Appends a carriage return to the message
func (*Logger) SetLogLevel ¶
SetLogLevel sets the minimum level of logs that will be output
Click to show internal directories.
Click to hide internal directories.