Documentation ¶
Index ¶
- Constants
- func ConfigureLogger(configLogEnabled bool, configLogStandard string, configLogPath string, ...)
- 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(logfmt string, logfile string) (writer io.Writer)
- func GetLogger() *logging.Logger
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func InitLogger()
- func NewMailLogger(configLogEnabled bool, configLogMail string, configLogMailLevel string) log.Logger
- func Warning(args ...interface{})
- func Warningf(format string, args ...interface{})
- type MailLogger
- type NoopBackend
- type WatermillLogger
- func (w *WatermillLogger) Debug(msg string, fields watermill.LogFields)
- func (w *WatermillLogger) Error(msg string, err error, fields watermill.LogFields)
- func (w *WatermillLogger) Info(msg string, fields watermill.LogFields)
- func (w *WatermillLogger) Trace(msg string, fields watermill.LogFields)
- func (w *WatermillLogger) With(_ watermill.LogFields) watermill.LoggerAdapter
- 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 ConfigureLogger ¶ added in v0.22.1
func ConfigureLogger(configLogEnabled bool, configLogStandard string, configLogPath string, configLogLevel string)
ConfigureLogger configures the global log handler
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
func GetLogger ¶
func GetLogger() *logging.Logger
GetLogger returns the logging instance. DO NOT USE THIS TO LOG STUFF.
Types ¶
type MailLogger ¶ added in v0.21.0
type MailLogger struct {
// contains filtered or unexported fields
}
func (*MailLogger) Debugf ¶ added in v0.21.0
func (m *MailLogger) Debugf(l log.Log)
func (*MailLogger) Errorf ¶ added in v0.21.0
func (m *MailLogger) Errorf(l log.Log)
func (*MailLogger) Infof ¶ added in v0.21.0
func (m *MailLogger) Infof(l log.Log)
func (*MailLogger) Warnf ¶ added in v0.21.0
func (m *MailLogger) Warnf(l log.Log)
type NoopBackend ¶ added in v0.19.0
type NoopBackend struct{}
NoopBackend doesn't log anything. Used in cases where we want to disable logging completely.
func (*NoopBackend) Log ¶ added in v0.19.0
func (n *NoopBackend) Log(_ logging.Level, _ int, _ *logging.Record) error
type WatermillLogger ¶ added in v0.17.0
type WatermillLogger struct {
// contains filtered or unexported fields
}
func NewWatermillLogger ¶ added in v0.17.0
func NewWatermillLogger(configLogEnabled bool, configLogEvents string, configLogEventsLevel string) *WatermillLogger
NewXormLogger creates and initializes a new watermill logger
func (*WatermillLogger) Debug ¶ added in v0.17.0
func (w *WatermillLogger) Debug(msg string, fields watermill.LogFields)
func (*WatermillLogger) Error ¶ added in v0.17.0
func (w *WatermillLogger) Error(msg string, err error, fields watermill.LogFields)
func (*WatermillLogger) Info ¶ added in v0.17.0
func (w *WatermillLogger) Info(msg string, fields watermill.LogFields)
func (*WatermillLogger) Trace ¶ added in v0.17.0
func (w *WatermillLogger) Trace(msg string, fields watermill.LogFields)
func (*WatermillLogger) With ¶ added in v0.17.0
func (w *WatermillLogger) With(_ watermill.LogFields) watermill.LoggerAdapter
type XormLogger ¶
type XormLogger struct {
// contains filtered or unexported fields
}
XormLogger holds an implementation of the xorm logger interface.
func NewXormLogger ¶
func NewXormLogger(configLogEnabled bool, configLogDatabase string, configLogDatabaseLevel 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