Documentation ¶
Overview ¶
Package log provides logging functionality to Trickster
Index ¶
- type Logger
- func (tl *Logger) Close()
- func (tl *Logger) Debug(event string, detail Pairs)
- func (tl *Logger) Error(event string, detail Pairs)
- func (tl *Logger) ErrorOnce(key string, event string, detail Pairs) bool
- func (tl *Logger) Fatal(code int, event string, detail Pairs)
- func (tl *Logger) HasWarnedOnce(key string) bool
- func (tl *Logger) Info(event string, detail Pairs)
- func (tl *Logger) InfoOnce(key string, event string, detail Pairs) bool
- func (tl *Logger) Level() string
- func (tl *Logger) SetLogLevel(logLevel string)
- func (tl *Logger) Trace(event string, detail Pairs)
- func (tl *Logger) Warn(event string, detail Pairs)
- func (tl *Logger) WarnOnce(key string, event string, detail Pairs) bool
- type Pairs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a container for the underlying log provider
func ConsoleLogger ¶
ConsoleLogger returns a Logger object that prints log events to the Console
func DefaultLogger ¶
func DefaultLogger() *Logger
DefaultLogger returns the default logger, which is the console logger at level "info"
func New ¶
New returns a Logger for the provided logging configuration. The returned Logger will write to files distinguished from other Loggers by the instance string.
func (*Logger) Close ¶
func (tl *Logger) Close()
Close closes any opened file handles that were used for logging.
func (*Logger) ErrorOnce ¶
ErrorOnce sends an "ERROR" event to the Logger only once per key Returns true if this invocation was the first, and thus sent to the Logger
func (*Logger) Fatal ¶
Fatal sends a "FATAL" event to the Logger and exits the program with the provided exit code
func (*Logger) HasWarnedOnce ¶
HasWarnedOnce returns true if a warning for the key has already been sent to the Logger
func (*Logger) InfoOnce ¶
InfoOnce sends a "INFO" event to the Logger only once per key. Returns true if this invocation was the first, and thus sent to the Logger
func (*Logger) SetLogLevel ¶
SetLogLevel sets the log level, defaulting to "Info" if the provided level is unknown