Documentation
¶
Overview ¶
DigiStratum GoLib - Logger
Index ¶
- type LogLevel
- type LogLevelIfc
- type Logger
- func (r Logger) Any(level LogLevel, format string, a ...interface{}) error
- func (r Logger) Crazy(format string, a ...interface{}) error
- func (r Logger) Debug(format string, a ...interface{}) error
- func (r Logger) Error(format string, a ...interface{}) error
- func (r Logger) Fatal(format string, a ...interface{}) error
- func (r *Logger) GetNewPrefixedLogger(prefix string) *Logger
- func (r Logger) Info(format string, a ...interface{}) error
- func (r *Logger) LogTimestamp(logTimestamp bool) *Logger
- func (r *Logger) SetLogWriter(logWriter lw.LogWriterIfc) *Logger
- func (r *Logger) SetMinLogLevel(minLogLevel LogLevel) *Logger
- func (r Logger) Trace(format string, a ...interface{}) error
- func (r Logger) Warn(format string, a ...interface{}) error
- type LoggerIfc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogLevel ¶
type LogLevel uint
const ( CRAZY LogLevel = iota // Crazy output: data structures, dumps, ASCII art, you name it TRACE // Where in the code base are we, and how were we called? DEBUG // What is our state and other helpful things for trouble shooting? INFO // What functional contract operation is running? WARN // What possible problem do we see that may need a human response? ERROR // What definite problem is there that will degrade functionality/performance? FATAL // What fundamental problem is there that is considered do or die? )
Log levels
func StringToLogLevel ¶
type LogLevelIfc ¶
type LogLevelIfc interface {
ToString() string
}
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewLogger ¶
Get a new (non-singleton) instance with a streamId meaningful to the caller (such as its runtime thread id)
func (*Logger) GetNewPrefixedLogger ¶
func (*Logger) LogTimestamp ¶
Set the logTimestamp state (defaults to true to enable timestamps in logger output)
func (*Logger) SetLogWriter ¶
func (r *Logger) SetLogWriter(logWriter lw.LogWriterIfc) *Logger
Replace the current LogWriter with something more to our liking
func (*Logger) SetMinLogLevel ¶
Set the minimum log level
type LoggerIfc ¶
type LoggerIfc interface {
GetNewPrefixedLogger(prefix string) *Logger
SetMinLogLevel(minLogLevel LogLevel) *Logger
SetLogWriter(logWriter lw.LogWriterIfc) *Logger
LogTimestamp(logTimestamp bool) *Logger
Any(level LogLevel, format string, a ...interface{}) error
Crazy(format string, a ...interface{}) error
Trace(format string, a ...interface{}) error
Debug(format string, a ...interface{}) error
Info(format string, a ...interface{}) error
Warn(format string, a ...interface{}) error
Error(format string, a ...interface{}) error
Fatal(format string, a ...interface{}) error
}
Click to show internal directories.
Click to hide internal directories.