Documentation ¶
Index ¶
- type Logger
- type StdLogger
- func (l *StdLogger) DebugEnabled() bool
- func (l *StdLogger) Error(args ...interface{})
- func (l *StdLogger) ErrorEnabled() bool
- func (l *StdLogger) Errorf(format string, args ...interface{})
- func (l *StdLogger) Errorln(args ...interface{})
- func (l *StdLogger) Info(args ...interface{})
- func (l *StdLogger) InfoEnabled() bool
- func (l *StdLogger) Infof(format string, args ...interface{})
- func (l *StdLogger) Infoln(args ...interface{})
- type StdLoggerBuilder
- func (b *StdLoggerBuilder) Build() (logger *StdLogger, err error)
- func (b *StdLoggerBuilder) Debug(flag bool) *StdLoggerBuilder
- func (b *StdLoggerBuilder) Error(flag bool) *StdLoggerBuilder
- func (b *StdLoggerBuilder) Info(flag bool) *StdLoggerBuilder
- func (b *StdLoggerBuilder) Streams(out io.Writer, err io.Writer) *StdLoggerBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface { // DebugEnabled returns true if the debug level is enabled. DebugEnabled() bool // InfoEnabled returns true if the information level is enabled. InfoEnabled() bool // Info prints an formatted output message // using fmt.Fprint function Info(args ...interface{}) // Error prints an formatted error message // using fmt.Fprint function Error(args ...interface{}) // Infof prints an formatted output message // using fmt.Fprintf function Infof(format string, args ...interface{}) // Errorf prints an formatted error message // using fmt.Fprintf function Errorf(format string, args ...interface{}) // Infoln prints an formatted output message // using fmt.Fprintln function Infoln(args ...interface{}) // Errorln prints an formatted error message // using fmt.Fprintln function Errorln(args ...interface{}) }
Logger is an Interface for logging messages in unified way
type StdLogger ¶
type StdLogger struct {
// contains filtered or unexported fields
}
StdLogger is a type of logger which uses standard output and error streams, or custom writers
func (*StdLogger) DebugEnabled ¶
DebugEnabled returns true iff the debug level is enabled.
func (*StdLogger) Error ¶
func (l *StdLogger) Error(args ...interface{})
Error prints an formatted error message using fmt.Fprint function
func (*StdLogger) ErrorEnabled ¶
ErrorEnabled returns true iff the error level is enabled.
func (*StdLogger) Errorln ¶
func (l *StdLogger) Errorln(args ...interface{})
Errorln prints an formatted error message using fmt.Fprintln function
func (*StdLogger) Info ¶
func (l *StdLogger) Info(args ...interface{})
Info prints an formatted output message using fmt.Fprint function
func (*StdLogger) InfoEnabled ¶
InfoEnabled returns true iff the information level is enabled.
type StdLoggerBuilder ¶
type StdLoggerBuilder struct {
// contains filtered or unexported fields
}
StdLoggerBuilder is a type which contains the configuration to build the logger which uses standard output and error streams or custom writers
func NewStdLoggerBuilder ¶
func NewStdLoggerBuilder() *StdLoggerBuilder
NewStdLoggerBuilder returns new StdLoggerBuilder object
func (*StdLoggerBuilder) Build ¶
func (b *StdLoggerBuilder) Build() (logger *StdLogger, err error)
Build creates a new logger instance with configuration stored in builder
func (*StdLoggerBuilder) Debug ¶
func (b *StdLoggerBuilder) Debug(flag bool) *StdLoggerBuilder
Debug enables or disables the debug level.
func (*StdLoggerBuilder) Error ¶
func (b *StdLoggerBuilder) Error(flag bool) *StdLoggerBuilder
Error enables or disables the error level.
func (*StdLoggerBuilder) Info ¶
func (b *StdLoggerBuilder) Info(flag bool) *StdLoggerBuilder
Info enables or disables the information level.
func (*StdLoggerBuilder) Streams ¶
func (b *StdLoggerBuilder) Streams(out io.Writer, err io.Writer) *StdLoggerBuilder
Streams set input output streams