Documentation ¶
Overview ¶
Package log implements a simple logging package.
Index ¶
- Constants
- func Critical(v ...interface{})
- func Criticalf(format string, v ...interface{})
- func Criticalln(v ...interface{})
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Debugln(v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Errorln(v ...interface{})
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Infoln(v ...interface{})
- func Layouts() int
- func Prefix() string
- func Print(v ...interface{})
- func Printf(format string, v ...interface{})
- func Println(v ...interface{})
- func Priority() int
- func SetDefaultDir(value string)
- func SetDefaultLayout(value int)
- func SetDefaultOutput(value int)
- func SetDefaultPriority(value int)
- func SetLayouts(value int)
- func SetPrefix(value string)
- func SetPriority(value int)
- func Trace(v ...interface{})
- func Tracef(format string, v ...interface{})
- func Traceln(v ...interface{})
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- func Warnln(v ...interface{})
- type Logger
- func (me *Logger) Critical(v ...interface{})
- func (me *Logger) Criticalf(format string, v ...interface{})
- func (me *Logger) Criticalln(v ...interface{})
- func (me *Logger) Debug(v ...interface{})
- func (me *Logger) Debugf(format string, v ...interface{})
- func (me *Logger) Debugln(v ...interface{})
- func (me *Logger) Error(v ...interface{})
- func (me *Logger) Errorf(format string, v ...interface{})
- func (me *Logger) Errorln(v ...interface{})
- func (me *Logger) Info(v ...interface{})
- func (me *Logger) Infof(format string, v ...interface{})
- func (me *Logger) Infoln(v ...interface{})
- func (me *Logger) Layouts() int
- func (me *Logger) Prefix() string
- func (me *Logger) Print(v ...interface{})
- func (me *Logger) Printf(format string, v ...interface{})
- func (me *Logger) Println(v ...interface{})
- func (me *Logger) Priority() int
- func (me *Logger) SetLayouts(layouts int)
- func (me *Logger) SetPrefix(prefix string)
- func (me *Logger) SetPriority(priority int)
- func (me *Logger) Trace(v ...interface{})
- func (me *Logger) Tracef(format string, v ...interface{})
- func (me *Logger) Traceln(v ...interface{})
- func (me *Logger) Warn(v ...interface{})
- func (me *Logger) Warnf(format string, v ...interface{})
- func (me *Logger) Warnln(v ...interface{})
- type Logging
- func (me *Logging) Critical(v ...interface{})
- func (me *Logging) Criticalf(format string, v ...interface{})
- func (me *Logging) Criticalln(v ...interface{})
- func (me *Logging) Debug(v ...interface{})
- func (me *Logging) Debugf(format string, v ...interface{})
- func (me *Logging) Debugln(v ...interface{})
- func (me *Logging) Error(v ...interface{})
- func (me *Logging) Errorf(format string, v ...interface{})
- func (me *Logging) Errorln(v ...interface{})
- func (me *Logging) Info(v ...interface{})
- func (me *Logging) Infof(format string, v ...interface{})
- func (me *Logging) Infoln(v ...interface{})
- func (me *Logging) Layouts() int
- func (me *Logging) Outputs() int
- func (me *Logging) Prefix() string
- func (me *Logging) Print(v ...interface{})
- func (me *Logging) Printf(format string, v ...interface{})
- func (me *Logging) Println(v ...interface{})
- func (me *Logging) Priority() int
- func (me *Logging) SetLayouts(value int)
- func (me *Logging) SetOutputs(value int)
- func (me *Logging) SetPrefix(value string)
- func (me *Logging) SetPriority(value int)
- func (me *Logging) Trace(v ...interface{})
- func (me *Logging) Tracef(format string, v ...interface{})
- func (me *Logging) Traceln(v ...interface{})
- func (me *Logging) Warn(v ...interface{})
- func (me *Logging) Warnf(format string, v ...interface{})
- func (me *Logging) Warnln(v ...interface{})
Constants ¶
const ( Pall = iota Ptrace Pdebug Pinfo Pwarn Perror Pcritical Pprint Poff )
Priority used for identifying the severity of an event.
const ( // Debug 2012/01/23 01:23:23.123123 /a/b/c/d.go:23: message Ldate = 1 << iota // the date in the local time zone: 2009/01/23 Ltime // the time in the local time zone: 01:23:23 Lmicroseconds // microsecond resolution: 01:23:23.123123. assumes Ltime. Llongfile // full file name and line number: /a/b/c/d.go:23 Lshortfile // final file name element and line number: d.go:23. overrides Llongfile LUTC // if Ldate or Ltime is set, use UTC rather than the local time zone Lpriority // the priority: Debug LstdFlags = Ldate | Ltime // initial values for the standard logger )
These layouts define which text to prefix to each log entry generated by the Logger.
const ( Oconsole = 1 << iota // the console logger Odailyfile // the daily file logger Orollingfile // the rolling file logger Ostd = Oconsole | Odailyfile // the console|daily file logger )
sets the outputs destination for the logger.
Variables ¶
This section is empty.
Functions ¶
func Critical ¶
func Critical(v ...interface{})
Critical calls Output to print to the logger with the Critical priority.
func Criticalf ¶
func Criticalf(format string, v ...interface{})
Criticalf calls Output to printf to the logger with the Critical priority.
func Criticalln ¶
func Criticalln(v ...interface{})
Criticalln calls Output to println to the logger with the Critical priority.
func Debug ¶
func Debug(v ...interface{})
Debug calls Output to print to the logger with the Debug priority.
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf calls Output to printf to the logger with the Debug priority.
func Debugln ¶
func Debugln(v ...interface{})
Debugln calls Output to println to the logger with the Debug priority.
func Error ¶
func Error(v ...interface{})
Error calls Output to print to the logger with the Error priority.
func Errorf ¶
func Errorf(format string, v ...interface{})
Errorf calls Output to printf to the logger with the Error priority.
func Errorln ¶
func Errorln(v ...interface{})
Errorln calls Output to println to the logger with the Error priority.
func Info ¶
func Info(v ...interface{})
Info calls Output to print to the logger with the Info priority.
func Infof ¶
func Infof(format string, v ...interface{})
Infof calls Output to printf to the logger with the Info priority.
func Infoln ¶
func Infoln(v ...interface{})
Infoln calls Output to println to the logger with the Info priority.
func Print ¶
func Print(v ...interface{})
Print calls Output to print to the logger with the Print priority.
func Printf ¶
func Printf(format string, v ...interface{})
Printf calls Output to printf to the logger with the Print priority.
func Println ¶
func Println(v ...interface{})
Println calls Output to println to the logger with the Print priority.
func SetDefaultPriority ¶
func SetDefaultPriority(value int)
SetDefaultPriority set the default priority.
func Trace ¶
func Trace(v ...interface{})
Trace calls Output to print to the logger with the Trace priority.
func Tracef ¶
func Tracef(format string, v ...interface{})
Tracef calls Output to printf to the logger with the Trace priority.
func Traceln ¶
func Traceln(v ...interface{})
Traceln calls Output to println to the logger with the Trace priority.
func Warn ¶
func Warn(v ...interface{})
Warn calls Output to print to the logger with the Warn priority.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger logger.
func (*Logger) Critical ¶
func (me *Logger) Critical(v ...interface{})
Critical calls output to print to the logger with the Critical priority.
func (*Logger) Criticalf ¶
Criticalf calls output to printf to the logger with the Critical priority.
func (*Logger) Criticalln ¶
func (me *Logger) Criticalln(v ...interface{})
Criticalln calls output to println to the logger with the Critical priority.
func (*Logger) Debug ¶
func (me *Logger) Debug(v ...interface{})
Debug calls output to print to the logger with the Debug priority.
func (*Logger) Debugln ¶
func (me *Logger) Debugln(v ...interface{})
Debugln calls output to println to the logger with the Debug priority.
func (*Logger) Error ¶
func (me *Logger) Error(v ...interface{})
Error calls output to print to the logger with the Error priority.
func (*Logger) Errorln ¶
func (me *Logger) Errorln(v ...interface{})
Errorln calls output to println to the logger with the Error priority.
func (*Logger) Info ¶
func (me *Logger) Info(v ...interface{})
Info calls output to print to the logger with the Info priority.
func (*Logger) Infoln ¶
func (me *Logger) Infoln(v ...interface{})
Infoln calls output to println to the logger with the Info priority.
func (*Logger) Print ¶
func (me *Logger) Print(v ...interface{})
Print calls output to print to the logger with the Print priority.
func (*Logger) Println ¶
func (me *Logger) Println(v ...interface{})
Println calls output to println to the logger with the Print priority.
func (*Logger) SetLayouts ¶
SetLayouts sets the output layouts for the logger.
func (*Logger) SetPriority ¶
SetPriority sets the output priority for the logger.
func (*Logger) Trace ¶
func (me *Logger) Trace(v ...interface{})
Trace calls output to print to the logger with the Trace priority.
func (*Logger) Traceln ¶
func (me *Logger) Traceln(v ...interface{})
Traceln calls output to println to the logger with the Trace priority.
func (*Logger) Warn ¶
func (me *Logger) Warn(v ...interface{})
Warn calls output to print to the logger with the Warn priority.
type Logging ¶
type Logging struct { Settings func() // The function executed before the log is printed and executed only once. // contains filtered or unexported fields }
Logging logging.
func NewLogging ¶
NewLogging creates a new Logging.
func (*Logging) Critical ¶
func (me *Logging) Critical(v ...interface{})
Critical calls Output to print to the logging with the Critical priority.
func (*Logging) Criticalf ¶
Criticalf calls Output to printf to the logging with the Critical priority.
func (*Logging) Criticalln ¶
func (me *Logging) Criticalln(v ...interface{})
Criticalln calls Output to println to the logging with the Critical priority.
func (*Logging) Debug ¶
func (me *Logging) Debug(v ...interface{})
Debug calls Output to print to the logging with the Debug priority.
func (*Logging) Debugln ¶
func (me *Logging) Debugln(v ...interface{})
Debugln calls Output to println to the logging with the Debug priority.
func (*Logging) Error ¶
func (me *Logging) Error(v ...interface{})
Error calls Output to print to the logging with the Error priority.
func (*Logging) Errorln ¶
func (me *Logging) Errorln(v ...interface{})
Errorln calls Output to println to the logging with the Error priority.
func (*Logging) Info ¶
func (me *Logging) Info(v ...interface{})
Info calls Output to print to the logging with the Info priority.
func (*Logging) Infoln ¶
func (me *Logging) Infoln(v ...interface{})
Infoln calls Output to println to the logging with the Info priority.
func (*Logging) Print ¶
func (me *Logging) Print(v ...interface{})
Print calls Output to print to the logging with the Print priority.
func (*Logging) Println ¶
func (me *Logging) Println(v ...interface{})
Println calls Output to println to the logging with the Print priority.
func (*Logging) SetLayouts ¶
SetLayouts sets the output layouts for the logging.
func (*Logging) SetOutputs ¶
SetOutputs sets the output outputs for the logging.
func (*Logging) SetPriority ¶
SetPriority sets the output priority for the logging.
func (*Logging) Trace ¶
func (me *Logging) Trace(v ...interface{})
Trace calls Output to print to the logging with the Trace priority.
func (*Logging) Traceln ¶
func (me *Logging) Traceln(v ...interface{})
Traceln calls Output to println to the logging with the Trace priority.
func (*Logging) Warn ¶
func (me *Logging) Warn(v ...interface{})
Warn calls Output to print to the logging with the Warn priority.