Documentation ¶
Index ¶
- Constants
- Variables
- type DisplayField
- type Logger
- func (log *Logger) Debug(args ...interface{})
- func (log *Logger) DebugDump(args ...interface{})
- func (log *Logger) Debugf(format string, args ...interface{})
- func (log *Logger) Debugln(args ...interface{})
- func (log *Logger) Error(args ...interface{})
- func (log *Logger) ErrorDump(args ...interface{})
- func (log *Logger) Errorf(format string, args ...interface{})
- func (log *Logger) Errorln(args ...interface{})
- func (log *Logger) Fatal(args ...interface{})
- func (log *Logger) FatalDump(args ...interface{})
- func (log *Logger) Fatalf(format string, args ...interface{})
- func (log *Logger) Fatalln(args ...interface{})
- func (log *Logger) Info(args ...interface{})
- func (log *Logger) InfoDump(args ...interface{})
- func (log *Logger) Infof(format string, args ...interface{})
- func (log *Logger) Infoln(args ...interface{})
- func (log *Logger) SetLogLevel(level string)
- func (log *Logger) Warning(args ...interface{})
- func (log *Logger) WarningDump(args ...interface{})
- func (log *Logger) Warningf(format string, args ...interface{})
- func (log *Logger) Warningln(args ...interface{})
- func (log *Logger) WithFields(fields []DisplayField)
Constants ¶
const DebugLevel = "debug"
DebugLevel denotes a shorthand notation for setting log level to 'debug'
const ErrorLevel = "error"
ErrorLevel denotes a shorthand notation for setting log level to 'error'
const FatalLevel = "fatal"
FatalLevel denotes a shorthand notation for setting log level to 'fatal'
const InfoLevel = "info"
InfoLevel denotes a shorthand notation for setting log level to 'info'
const WarningLevel = "warning"
WarningLevel denotes a shorthand notation for setting log level to 'warning'
Variables ¶
var RemoteURL = ""
RemoteURL is the location where the log message is sent to
Functions ¶
This section is empty.
Types ¶
type DisplayField ¶
type DisplayField struct { Name string Value interface{} }
DisplayField stores the name and the value of the field that needs to be printed along with the log message
type Logger ¶
type Logger struct { OrganizationName string `json:"organization_name"` ApplicationName string `json:"application_name"` RemoteAvailable bool // Stores if the struct needs to be pushed to the remote URL LineNumber bool // Stores if the file, function, and the line number need to be printed with every log LogLevel string // Stores the log level; values are debug, info, warning, error and fatal // Customizable colors // Info colors InfoColor *color.Color // Color of the info message InfoTimeColor *color.Color // Color of the info timestamp InfoMessageTypeColor *color.Color // Color of the message type // Debug colors DebugColor *color.Color // Color of the debug message DebugTimeColor *color.Color // Color of the debug timestamp DebugMessageTypeColor *color.Color // Color of the message type // Warning colors WarningColor *color.Color // Color of the warning message WarningTimeColor *color.Color // Color of the warning timestamp WarningMessageTypeColor *color.Color // Color of the message type // Error colors ErrorColor *color.Color // Color of the error message ErrorTimeColor *color.Color // Color of the error timestamp ErrorMessageTypeColor *color.Color // Color of the message type // fatal colors FatalColor *color.Color // Color of the fatal message FatalTimeColor *color.Color // Color of the fatal timestamp FatalMessageTypeColor *color.Color // Color of the message type // contains filtered or unexported fields }
Logger is the main logging object
func (*Logger) Debug ¶
func (log *Logger) Debug(args ...interface{})
Debug displays a debugging message useful in development environment
func (*Logger) DebugDump ¶
func (log *Logger) DebugDump(args ...interface{})
DebugDump displays the dump of the variables passed using the go-spew library
func (*Logger) Debugln ¶
func (log *Logger) Debugln(args ...interface{})
Debugln displays a debugging message
func (*Logger) Error ¶
func (log *Logger) Error(args ...interface{})
Error displays an error message
func (*Logger) ErrorDump ¶
func (log *Logger) ErrorDump(args ...interface{})
ErrorDump displays the dump of the variables passed using the go-spew library
func (*Logger) Errorln ¶
func (log *Logger) Errorln(args ...interface{})
Errorln displays an error message
func (*Logger) Fatal ¶
func (log *Logger) Fatal(args ...interface{})
Fatal displays a message and crashes the program
func (*Logger) FatalDump ¶
func (log *Logger) FatalDump(args ...interface{})
FatalDump displays the dump of the variables passed using the go-spew library
func (*Logger) Fatalln ¶
func (log *Logger) Fatalln(args ...interface{})
Fatalln displays a message and crashes the program
func (*Logger) Info ¶
func (log *Logger) Info(args ...interface{})
Info displays a non-fatal log message
func (*Logger) InfoDump ¶
func (log *Logger) InfoDump(args ...interface{})
InfoDump displays the dump of the variables passed using the go-spew library
func (*Logger) Infoln ¶
func (log *Logger) Infoln(args ...interface{})
Infoln displays a non-fatal log message
func (*Logger) SetLogLevel ¶
SetLogLevel sets the log level of the logger
func (*Logger) Warning ¶
func (log *Logger) Warning(args ...interface{})
Warning displays a warning message
func (*Logger) WarningDump ¶
func (log *Logger) WarningDump(args ...interface{})
WarningDump displays the dump of the variables passed using the go-spew library
func (*Logger) Warningln ¶
func (log *Logger) Warningln(args ...interface{})
Warningln displays a warning message
func (*Logger) WithFields ¶
func (log *Logger) WithFields(fields []DisplayField)
WithFields adds the passed fields and attaches them to the logging object