Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Levels = []string{"TRACE", "DEBUG", "INFO", "WARN", "ERR"}
Levels are the log levels we respond too.
var LogLevel = ""
LogLevel is the log level of all logs in this package it is set by the Setup() function and is shared with all other setup variations (i.e. SetupLocal())
Functions ¶
func DisableLogging ¶ added in v0.5.0
func DisableLogging()
Types ¶
type Config ¶
type Config struct { // Level is the log level to use. Level string // Syslog and SyslogFacility is the syslog configuration options. Syslog bool SyslogFacility string // SyslogName is the progname as it will appear in syslog output (if enabled). SyslogName string // Writer is the output where logs should go. If syslog is enabled, data will // be written to writer in addition to syslog. Writer io.Writer }
Config is the configuration for this log setup.
type Level ¶ added in v0.7.0
type Level = hclog.Level
Alias the hclog levels so that the hclog package doesn't need to be exposed for `logger.Log(...)` calls.
type Logger ¶ added in v0.4.0
type Logger hclog.Logger
Logger is a type alias for hclog.Logger
func FromContext ¶ added in v0.4.0
FromContext returns the Logger contained with the context. If no Logger is found in the context, this function returns the Global Logger
func Global ¶ added in v0.4.0
func Global() Logger
Global returns the hclog.Default() global logger as type Logger
func NewNullLogger ¶ added in v0.4.0
func NewNullLogger() Logger
NewNullLogger returns the hclog.NewNullLogger() null logger as type Logger
func NewTestLogger ¶ added in v0.6.0
NewTestLogger configures a new logger using a provided logLevel and output and returns the new hclog.Logger as type Logger
type SyslogWrapper ¶
type SyslogWrapper struct {
// contains filtered or unexported fields
}
SyslogWrapper is used to cleanup log messages before writing them to a Syslogger. Implements the io.Writer interface.