Documentation ¶
Index ¶
- Constants
- func Critical(args ...interface{})
- func Criticalf(format string, args ...interface{})
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func GetLogWriter(logfile string) (writer io.Writer)
- func GetLogger() *logging.Logger
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func InitLogger()
- func Warning(args ...interface{})
- func Warningf(format string, args ...interface{})
- type XormLogger
- func (x *XormLogger) Debug(v ...interface{})
- func (x *XormLogger) Debugf(format string, v ...interface{})
- func (x *XormLogger) Error(v ...interface{})
- func (x *XormLogger) Errorf(format string, v ...interface{})
- func (x *XormLogger) Info(v ...interface{})
- func (x *XormLogger) Infof(format string, v ...interface{})
- func (x *XormLogger) IsShowSQL() bool
- func (x *XormLogger) Level() log.LogLevel
- func (x *XormLogger) SetLevel(l log.LogLevel)
- func (x *XormLogger) ShowSQL(show ...bool)
- func (x *XormLogger) Warn(v ...interface{})
- func (x *XormLogger) Warnf(format string, v ...interface{})
Constants ¶
const ErrFmt = `${time_rfc3339_nano}: ${level} ` + "\t" + `▶ ${prefix} ${short_file}:${line}`
ErrFmt holds the format for all the console logging
const Fmt = `%{color}%{time:` + time.RFC3339Nano + `}: %{level}` + "\t" + `▶ %{shortpkg}/%{shortfunc} %{id:03x}%{color:reset} %{message}`
Fmt is the general log format
const WebFmt = `${time_rfc3339_nano}: WEB ` + "\t" + `▶ ${remote_ip} ${id} ${method} ${status} ${uri} ${latency_human} - ${user_agent}`
WebFmt holds the format for all logging related to web requests
const XormFmt = `%{color}%{time:` + time.RFC3339Nano + `}: %{level}` + "\t" + `▶ [DATABASE] %{id:03x}%{color:reset} %{message}`
XormFmt defines the format for xorm logging strings
Variables ¶
This section is empty.
Functions ¶
func Criticalf ¶
func Criticalf(format string, args ...interface{})
Criticalf is for critical messages
func GetLogWriter ¶
GetLogWriter returns the writer to where the normal log goes, depending on the config
Types ¶
type XormLogger ¶
type XormLogger struct {
// contains filtered or unexported fields
}
XormLogger holds an implementation of the xorm logger interface.
func NewXormLogger ¶
func NewXormLogger(lvl string) *XormLogger
NewXormLogger creates and initializes a new xorm logger
func (*XormLogger) Debugf ¶
func (x *XormLogger) Debugf(format string, v ...interface{})
Debugf logs a debug string
func (*XormLogger) Errorf ¶
func (x *XormLogger) Errorf(format string, v ...interface{})
Errorf logs a debug string
func (*XormLogger) Infof ¶
func (x *XormLogger) Infof(format string, v ...interface{})
Infof logs an info string
func (*XormLogger) IsShowSQL ¶
func (x *XormLogger) IsShowSQL() bool
IsShowSQL returns if sql queries should be shown
func (*XormLogger) Level ¶
func (x *XormLogger) Level() log.LogLevel
Level returns the current set log level
func (*XormLogger) SetLevel ¶
func (x *XormLogger) SetLevel(l log.LogLevel)
SetLevel sets the log level
func (*XormLogger) ShowSQL ¶
func (x *XormLogger) ShowSQL(show ...bool)
ShowSQL sets whether to show the log level or not
func (*XormLogger) Warnf ¶
func (x *XormLogger) Warnf(format string, v ...interface{})
Warnf logs a warning string