Documentation
¶
Index ¶
- type Logger
- type StdLogger
- func (l *StdLogger) Debug(args ...interface{})
- func (l *StdLogger) DebugEnabled() bool
- func (l *StdLogger) Debugf(format string, args ...interface{})
- func (l *StdLogger) Error(args ...interface{})
- func (l *StdLogger) ErrorEnabled() bool
- func (l *StdLogger) Errorf(format string, args ...interface{})
- func (l *StdLogger) Info(args ...interface{})
- func (l *StdLogger) InfoEnabled() bool
- func (l *StdLogger) Infof(format string, args ...interface{})
- func (l *StdLogger) SetDebug(b bool)
- 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
// SetDebug sets/unsets the debug level for the logger
SetDebug(b bool)
// Debug sends to the log a debug message formatted using the fmt.Sprintf function and the
// given format and arguments.
Debug(args ...interface{})
// Debugf sends to the log a debug message formatted using the fmt.Sprintf function and the
// given format and arguments.
Debugf(format string, args ...interface{})
// Info sends to the log an information message formatted using the fmt.Sprintf function and
// the given format and arguments.
Info(args ...interface{})
// Infof sends to the log an information message formatted using the fmt.Sprintf function and
// the given format and arguments.
Infof(format string, args ...interface{})
// Error sends to the log an error message formatted using the fmt.Sprintln function and the
// given format and arguments.
Error(args ...interface{})
// Errorf sends to the log an error message formatted using the fmt.Sprint function and the
// given format and arguments.
Errorf(format string, args ...interface{})
}
type StdLogger ¶
type StdLogger struct {
// contains filtered or unexported fields
}
StdLogger is a logger that uses the standard output and error streams, or custom writers.
func (*StdLogger) Debug ¶
func (l *StdLogger) Debug(args ...interface{})
Debug sends to the log a debug message formatted using the fmt.Fprintln function and the given arguments.
func (*StdLogger) DebugEnabled ¶
DebugEnabled returns true iff the debug level is enabled.
func (*StdLogger) Debugf ¶
Debugf sends to the log a debug message formatted using the fmt.Fprintf function and the given format and arguments.
func (*StdLogger) Error ¶
func (l *StdLogger) Error(args ...interface{})
Error sends to the log an error message formatted using the fmt.Fprintln function and the given arguments.
func (*StdLogger) ErrorEnabled ¶
ErrorEnabled returns true iff the error level is enabled.
func (*StdLogger) Errorf ¶
Errorf sends to the log an error message formatted using the fmt.Fprintf function and the given format and arguments.
func (*StdLogger) Info ¶
func (l *StdLogger) Info(args ...interface{})
Info sends to the log an information message formatted using the fmt.Fprintln function and the given arguments.
func (*StdLogger) InfoEnabled ¶
InfoEnabled returns true iff the information level is enabled.
type StdLoggerBuilder ¶
type StdLoggerBuilder struct {
// contains filtered or unexported fields
}
StdLoggerBuilder contains the configuration and logic needed to build a logger that uses the standard output and error streams, or custom writers.
func NewStdLoggerBuilder ¶
func NewStdLoggerBuilder() *StdLoggerBuilder
NewStdLoggerBuilder creates a builder that knows how to build a logger that uses the standard output and error streams, or custom writers. By default these loggers will have enabled the information, warning and error levels
func (*StdLoggerBuilder) Build ¶
func (b *StdLoggerBuilder) Build() (logger *StdLogger, err error)
Build creates a new logger using the configuration stored in the 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 sets the standard output and error streams to use. If not used then the logger will use os.Stdout and os.Stderr.