Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Testing = false TestBuffer *bytes.Buffer )
Test specific variables, these should never be set unless from within a test file.
Functions ¶
func ConfigureTargets ¶
ConfigureTargets takes a 'JSON' map that defines what log targets there should be and converts them into an io.Writer suitable for being the target of a logrus.Output, this can be a io.MultiWriter or just a writer
Types ¶
type Log ¶
type Log interface {
Debug(args ...interface{})
Debugf(format string, args ...interface{})
Debugln(args ...interface{})
Error(args ...interface{})
Errorf(format string, args ...interface{})
Errorln(args ...interface{})
Fatal(args ...interface{})
Fatalf(format string, args ...interface{})
Fatalln(args ...interface{})
Info(args ...interface{})
Infof(format string, args ...interface{})
Infoln(args ...interface{})
Panic(args ...interface{})
Panicf(format string, args ...interface{})
Panicln(args ...interface{})
Print(args ...interface{})
Printf(format string, args ...interface{})
Println(args ...interface{})
Warn(args ...interface{})
Warnf(format string, args ...interface{})
Warning(args ...interface{})
Warningf(format string, args ...interface{})
Warningln(args ...interface{})
Warnln(args ...interface{})
WithError(err error) Log
WithField(key string, value interface{}) Log
WithFields(fields Fields) Log
SetLevel(LogLevel)
SetOut(io.Writer)
}
Log wraps a series of logging fields that should be implemented on any log type.
func New ¶
func New() Log
New will return an instance of the log utility that should be used for send messages to the user. PREFER LogWithSource.
func NewWithSource ¶
NewWithSource returns a log with a predefined "source" field attached to it. This should be the primary method used to fetch a logger for use in other parts fo the code.
type LogLevel ¶
type LogLevel uint8
Log level definitions for the Log interface
func GetLogLevel ¶
GetLogLevel converts a string value to a logrus.Level value for use in providing configuration for the logger from the Gamefile.