Documentation ¶
Overview ¶
package glug provides a logging framework for modular applications
Construct a `Logger` by calling `MakeLogger` once per package, then use that logger throughout that package. You can set individual logging levels per package by calling `SetLoggerLevel("PackageName",LevelDebug)`. To enable `Debug` and `Trace` levels you must compile with `-tags debug` or the calls are empty.
Index ¶
- Constants
- func Chain(err error, cause error) error
- func Combine(errs []error) error
- func SetLoggerLevel(name string, level int) bool
- func Wrap(err error, reason string) error
- func Wrapf(err error, format string, args ...interface{}) error
- type ChainError
- type KV
- type Logger
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(fmt string, args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(fmt string, args ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(fmt string, args ...interface{})
- func (l *Logger) Log(level int, args ...interface{})
- func (l *Logger) Logf(level int, format string, args ...interface{})
- func (l *Logger) Trace(args ...interface{})
- func (l *Logger) Tracef(fmt string, args ...interface{})
- func (l *Logger) Weird(args ...interface{})
- func (l *Logger) Weirdf(fmt string, args ...interface{})
- type MultiError
- type WrappedError
Constants ¶
View Source
const ( // Inside loops LevelTrace = -8 // Packets LevelDebug = 0 // Connections, disconnects, normal operation LevelInfo = 8 // Interesting config values LevelWeird = 16 // Unreachable, Unable to open config LevelError = 24 )
Variables ¶
This section is empty.
Functions ¶
func SetLoggerLevel ¶
Types ¶
type ChainError ¶
type ChainError []error
func (ChainError) Error ¶
func (c ChainError) Error() string
func (ChainError) String ¶
func (c ChainError) String() string
type MultiError ¶
type MultiError []error
func (MultiError) Error ¶
func (m MultiError) Error() string
func (MultiError) String ¶
func (m MultiError) String() string
type WrappedError ¶
func (WrappedError) Error ¶
func (e WrappedError) Error() string
func (WrappedError) String ¶
func (e WrappedError) String() string
Click to show internal directories.
Click to hide internal directories.