Documentation ¶
Index ¶
- type LogType
- type Logger
- func (logger *Logger) Debug(message ...interface{})
- func (logger *Logger) Debugf(message string, args ...interface{})
- func (logger *Logger) DisableColors()
- func (logger *Logger) EnableColors()
- func (logger *Logger) Error(message ...interface{})
- func (logger *Logger) Errorf(message string, args ...interface{})
- func (logger *Logger) Fatal(message ...interface{})
- func (logger *Logger) Fatalf(message string, args ...interface{})
- func (logger *Logger) Info(message ...interface{})
- func (logger *Logger) Infof(message string, args ...interface{})
- func (logger *Logger) Warning(message ...interface{})
- func (logger *Logger) Warningf(message string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogType ¶
type LogType int
LogType represents a type and level of logging
Constants for the type and levels of logging
func StringToLogType ¶
StringToLogType converts a specified string to a LogType. If the string does not match a specific log type the NONE is returned.
type Logger ¶
type Logger struct { ApplicationName string LogLevel LogType // contains filtered or unexported fields }
Logger represents an instance of a log structure
func NewLogger ¶
NewLogger creates a new Logger instance with a specific application name. The application name is a prefix used in all log messges.
func NewLoggerWithMinimumLevel ¶
NewLoggerWithMinimumLevel creates a new Logger instance that only logs messages with a specified log type level or higher.
func (*Logger) Debug ¶
func (logger *Logger) Debug(message ...interface{})
Debug writes a debug entry to the log
func (*Logger) DisableColors ¶
func (logger *Logger) DisableColors()
DiableColors turns of console coloring
func (*Logger) EnableColors ¶
func (logger *Logger) EnableColors()
EnableColors turns on console coloring
func (*Logger) Error ¶
func (logger *Logger) Error(message ...interface{})
Error writes an error message to the log
func (*Logger) Fatal ¶
func (logger *Logger) Fatal(message ...interface{})
Fatal writes a fatal log messge
func (*Logger) Info ¶
func (logger *Logger) Info(message ...interface{})
Info writes an information message to the log