Documentation ¶
Overview ¶
Package console provides a (console) logger that implements the allmark.io/modules/common/logger.Logger interface.
Index ¶
- Constants
- type ConsoleLogger
- func (logger *ConsoleLogger) Debug(format string, v ...interface{})
- func (logger *ConsoleLogger) Error(format string, v ...interface{})
- func (logger *ConsoleLogger) Fatal(format string, v ...interface{})
- func (logger *ConsoleLogger) Info(format string, v ...interface{})
- func (logger *ConsoleLogger) Level() loglevel.LogLevel
- func (logger *ConsoleLogger) SetOutput(w io.Writer)
- func (logger *ConsoleLogger) Statistics(format string, v ...interface{})
- func (logger *ConsoleLogger) Warn(format string, v ...interface{})
Constants ¶
const ( LogLevelDebug = "Debug" LogLevelInfo = "Info" LogLevelStatistics = "Statistics" LogLevelWarn = "Warn" LogLevelError = "Error" LogLevelFatal = "Fatal" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsoleLogger ¶
type ConsoleLogger struct {
// contains filtered or unexported fields
}
ConsoleLogger implements the allmark.io/modules/common/logger.Logger interface and provides the ability to write log messages to a given output writer.
func Default ¶
func Default() *ConsoleLogger
Default creates a default ConsoleLogger with the Info log level and os.Stdout as the output target.
func New ¶
func New(level loglevel.LogLevel) *ConsoleLogger
New creates a new instance of the ConsoleLogger with os.Stdout as the output target.
func (*ConsoleLogger) Debug ¶
func (logger *ConsoleLogger) Debug(format string, v ...interface{})
Debug formats according to a format specifier and writes a debug log message to standard output.
func (*ConsoleLogger) Error ¶
func (logger *ConsoleLogger) Error(format string, v ...interface{})
Error formats according to a format specifier and writes an error log message to standard output.
func (*ConsoleLogger) Fatal ¶
func (logger *ConsoleLogger) Fatal(format string, v ...interface{})
Fatal formats according to a format specifier and writes a fatal log message to standard output and exits the application.
func (*ConsoleLogger) Info ¶
func (logger *ConsoleLogger) Info(format string, v ...interface{})
Info formats according to a format specifier and writes an info log message to standard output.
func (*ConsoleLogger) Level ¶
func (logger *ConsoleLogger) Level() loglevel.LogLevel
Level returns the current log level.
func (*ConsoleLogger) SetOutput ¶
func (logger *ConsoleLogger) SetOutput(w io.Writer)
SetOutput sets the output of this logger to the supplied io.Writer.
func (*ConsoleLogger) Statistics ¶
func (logger *ConsoleLogger) Statistics(format string, v ...interface{})
Statistics formats according to a format specifier and writes a statistics log message to standard output.
func (*ConsoleLogger) Warn ¶
func (logger *ConsoleLogger) Warn(format string, v ...interface{})
Warn formats according to a format specifier and writes a warn log message to standard output.