Documentation ¶
Overview ¶
Package log implements a simple library for message logging
Index ¶
- func AddAlertFunc(f ChangeLevelAlertFunc) int64
- func DelAlertFunc(id int64)
- func Disable()
- func Enable()
- func FileName() string
- func FileNamePattern() string
- func GetLastLog() []string
- func GetLogLevelName(level Level) (short string, long string)
- func GetLogLevels() []string
- func MaxLen(ln int) int
- func Message(level Level, message string, params ...interface{})
- func MessageEx(shift int, level Level, replace *Replace, message string, ...)
- func MessageWithSource(level Level, source string, message string, params ...interface{})
- func SecuredMessage(level Level, replace *Replace, message string, params ...interface{})
- func SecuredMessageWithSource(level Level, replace *Replace, source string, message string, ...)
- func SetConsoleWriter(writer io.Writer)
- func SetFile(directory string, suffix string, useLocalTime bool, bufSize int, ...)
- func SetTestWriter(stream *testing.T)
- func StdLogger(level string, message string, params ...interface{})
- type ChangeLevelAlertFunc
- type ConsoleWriter
- type Level
- type Replace
- type ServiceLogger
- func (l *ServiceLogger) Error(v ...interface{}) error
- func (l *ServiceLogger) Errorf(message string, a ...interface{}) error
- func (l *ServiceLogger) Info(v ...interface{}) error
- func (l *ServiceLogger) Infof(message string, a ...interface{}) error
- func (l *ServiceLogger) Warning(v ...interface{}) error
- func (l *ServiceLogger) Warningf(message string, a ...interface{}) error
- type Testwriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLogLevelName ¶
GetLogLevelName -- get log level names
func MessageWithSource ¶
MessageWithSource -- add message to the log with source
func SecuredMessage ¶ added in v0.1.6
SecuredMessage -- add message to the log with securing
func SecuredMessageWithSource ¶ added in v0.1.6
func SecuredMessageWithSource(level Level, replace *Replace, source string, message string, params ...interface{})
SecuredMessageWithSource -- add message to the log with source & securing
Types ¶
type ChangeLevelAlertFunc ¶
ChangeLevelAlertFunc --
type Level ¶
type Level int
Level -- level of the logging
const ( // EMERG -- system is unusable EMERG Level = iota // ALERT -- action must be taken immediately ALERT // CRIT -- critical conditions CRIT // ERR -- error conditions ERR // WARNING -- warning conditions WARNING // NOTICE -- normal but significant condition NOTICE // INFO -- informational INFO // DEBUG -- debug-level messages DEBUG // TRACE1 -- trace 1 TRACE1 // TRACE2 -- trace 2 TRACE2 // TRACE3 -- trace 3 TRACE3 // TRACE4 -- trace 4 TRACE4 // UNKNOWN -- unknown level UNKNOWN )
func GetCurrentLogLevel ¶
GetCurrentLogLevel -- get log level
func SetCurrentLogLevel ¶
SetCurrentLogLevel -- set log level
type ServiceLogger ¶
type ServiceLogger struct{}
ServiceLogger --
func (*ServiceLogger) Errorf ¶
func (l *ServiceLogger) Errorf(message string, a ...interface{}) error
Errorf --
func (*ServiceLogger) Infof ¶
func (l *ServiceLogger) Infof(message string, a ...interface{}) error
Infof --
func (*ServiceLogger) Warningf ¶
func (l *ServiceLogger) Warningf(message string, a ...interface{}) error
Warningf --
type Testwriter ¶
type Testwriter struct {
// contains filtered or unexported fields
}
Testwriter --
Click to show internal directories.
Click to hide internal directories.