Documentation ¶
Overview ¶
Package log provides methods for writing logs to Alt4 Methods in this package write logs asynchronously unless otherwise specified. You can call the function `Result` after log which will block if the operation is not done. The advised behaviour is to group your logs and defer the Close method which will wait for all operations to finish
Index ¶
- Variables
- func Debug(v ...interface{}) *service.LogResult
- func Debugf(format string, v ...interface{}) *service.LogResult
- func Debugln(v ...interface{}) *service.LogResult
- func Error(v ...interface{}) *service.LogResult
- func Errorf(format string, v ...interface{}) *service.LogResult
- func Errorln(v ...interface{}) *service.LogResult
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Fatalln(v ...interface{})
- func Info(v ...interface{}) *service.LogResult
- func Infof(format string, v ...interface{}) *service.LogResult
- func Infoln(v ...interface{}) *service.LogResult
- func Panic(v ...interface{})
- func Panicf(format string, v ...interface{})
- func Panicln(v ...interface{})
- func Print(v ...interface{}) *service.LogResult
- func Printf(format string, v ...interface{}) *service.LogResult
- func Println(v ...interface{}) *service.LogResult
- func Warning(v ...interface{}) *service.LogResult
- func Warningf(format string, v ...interface{}) *service.LogResult
- func Warningln(v ...interface{}) *service.LogResult
- type Claims
- func (claims Claims) Debug(v ...interface{}) *service.LogResult
- func (claims Claims) Debugf(format string, v ...interface{}) *service.LogResult
- func (claims Claims) Debugln(v ...interface{}) *service.LogResult
- func (claims Claims) Error(v ...interface{}) *service.LogResult
- func (claims Claims) Errorf(format string, v ...interface{}) *service.LogResult
- func (claims Claims) Errorln(v ...interface{}) *service.LogResult
- func (claims Claims) Fatal(v ...interface{})
- func (claims Claims) Fatalf(format string, v ...interface{})
- func (claims Claims) Fatalln(v ...interface{})
- func (claims Claims) Group(v ...interface{}) *GroupResult
- func (claims Claims) Info(v ...interface{}) *service.LogResult
- func (claims Claims) Infof(format string, v ...interface{}) *service.LogResult
- func (claims Claims) Infoln(v ...interface{}) *service.LogResult
- func (claims Claims) Panic(v ...interface{})
- func (claims Claims) Panicf(format string, v ...interface{})
- func (claims Claims) Panicln(v ...interface{})
- func (claims Claims) Print(v ...interface{}) *service.LogResult
- func (claims Claims) Printf(format string, v ...interface{}) *service.LogResult
- func (claims Claims) Println(v ...interface{}) *service.LogResult
- func (claims Claims) Warning(v ...interface{}) *service.LogResult
- func (claims Claims) Warningf(format string, v ...interface{}) *service.LogResult
- func (claims Claims) Warningln(v ...interface{}) *service.LogResult
- type GroupResult
Constants ¶
This section is empty.
Variables ¶
var BuiltInExit func(code int) = func(code int) { os.Exit(code) }
BuiltInExit Internally this function just calls os.Exit. Override for testing(Fatal, Fatalf, Fatalln)
var BuiltInPanic func(v interface{}) = func(v interface{}) { panic(v) }
BuiltInPanic Internally this function just calls panic(). Override for testing(Panic, Panicf, Panicln)
Functions ¶
func Debug ¶
Debug send a log message to alt4. The log level is DEBUG. Log message will be formatted by fmt.Sprint(a...)
func Debugf ¶
Debugf send a log message to alt4. The log level is DEBUG. Log message will be formatted by fmt.Sprintf(a...)
func Debugln ¶
Debugln send a log message to alt4. The log level is DEBUG. Log message will be formatted by fmt.Sprintln(a...)
func Error ¶
Error send a log message to alt4. The log level is ERROR. Log message will be formatted by fmt.Sprint(a...)
func Errorf ¶
Errorf send a log message to alt4. The log level is ERROR. Log message will be formatted by fmt.Sprintf(a...)
func Errorln ¶
Errorln send a log message to alt4. The log level is ERROR. Log message will be formatted by fmt.Sprintln(a...)
func Fatal ¶
func Fatal(v ...interface{})
Fatal This is equivalent to calling Print followed by os.Exit(1). The log level is FATAL. This method will wait for the write to complete
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Fatalf This is equivalent to calling Printf followed by os.Exit(1). The log level is FATAL. This method will wait for the write to complete
func Fatalln ¶
func Fatalln(v ...interface{})
Fatalln This is equivalent to calling Println followed by os.Exit(1). The log level is FATAL. This method will wait for the write to complete
func Info ¶
Info send a log message to alt4. The log level is INFO. Log message will be formatted by fmt.Sprint(a...)
func Infof ¶
Infof send a log message to alt4. The log level is INFO. Log message will be formatted by fmt.Sprintf(a...)
func Infoln ¶
Infoln send a log message to alt4. The log level is DEBUG. Log message will be formatted by fmt.Sprintln(a...)
func Panic ¶
func Panic(v ...interface{})
Panic This is equivalent to calling Print followed by panic(). The log level is FATAL. This method will wait for the write to complete
func Panicf ¶
func Panicf(format string, v ...interface{})
Panicf This is equivalent to calling Printf followed by panic(). The log level is FATAL. This method will wait for the write to complete
func Panicln ¶
func Panicln(v ...interface{})
Panicln This is equivalent to calling Println followed by panic(). The log level is FATAL. This method will wait for the write to complete
func Print ¶
Print send a log message to alt4. The log level is NONE. Log message will be formatted by fmt.Sprint(a...)
func Printf ¶
Printf send a log message to alt4. The log level is NONE. Log message will be formatted by fmt.Sprintf(a...)
func Println ¶
Println send a log message to alt4. The log level is NONE. Log message will be formatted by fmt.Sprintln(a...)
func Warning ¶
Warning send a log message to alt4. The log level is WARNING. Log message will be formatted by fmt.Sprint(a...)
Types ¶
type Claims ¶
type Claims map[string]interface{}
Claims are fields that will can be associated to your log entry. They can be used to filter and better identify your logs.
func (Claims) Debug ¶
Debug send claims and the log message to alt4. The log level is DEBUG. Log message will be formatted by fmt.Sprint(a...)
func (Claims) Debugf ¶
Debugf send claims and the log message to alt4. The log level is DEBUG. Log message will be formatted by fmt.Sprintf(a...)
func (Claims) Debugln ¶
Debugln send claims and the log message to alt4. The log level is DEBUG. Log message will be formatted by fmt.Sprintln(a...)
func (Claims) Error ¶
Error send claims and the log message to alt4. The log level is ERROR. Log message will be formatted by fmt.Sprint(a...)
func (Claims) Errorf ¶
Errorf send claims and the log message to alt4. The log level is ERROR. Log message will be formatted by fmt.Sprintf(a...)
func (Claims) Errorln ¶
Errorln send claims and the log message to alt4. The log level is ERROR. Log message will be formatted by fmt.Sprintln(a...)
func (Claims) Fatal ¶
func (claims Claims) Fatal(v ...interface{})
Fatal This is equivalent to calling Print followed by os.Exit(1). The log level is FATAL. This method will wait for the write to complete
func (Claims) Fatalf ¶
Fatalf This is equivalent to calling Printf followed by os.Exit(1). The log level is FATAL. This method will wait for the write to complete
func (Claims) Fatalln ¶
func (claims Claims) Fatalln(v ...interface{})
Fatalln This is equivalent to calling Println followed by os.Exit(1). The log level is FATAL. This method will wait for the write to complete
func (Claims) Group ¶
func (claims Claims) Group(v ...interface{}) *GroupResult
Group start a log group for the goroutine that calls this function. A group should be closed after. Use: `defer Claims{...}.Group(...).Close()`
func (Claims) Info ¶
Info send claims and the log message to alt4. The log level is INFO. Log message will be formatted by fmt.Sprint(a...)
func (Claims) Infof ¶
Infof send claims and the log message to alt4. The log level is INFO. Log message will be formatted by fmt.Sprintf(a...)
func (Claims) Infoln ¶
Infoln send claims and the log message to alt4. The log level is DEBUG. Log message will be formatted by fmt.Sprintln(a...)
func (Claims) Panic ¶
func (claims Claims) Panic(v ...interface{})
Panic This is equivalent to calling Print followed by panic(). The log level is FATAL. This method will wait for the write to complete
func (Claims) Panicf ¶
Panicf This is equivalent to calling Printf followed by panic(). The log level is FATAL. This method will wait for the write to complete
func (Claims) Panicln ¶
func (claims Claims) Panicln(v ...interface{})
Panicln This is equivalent to calling Println followed by panic(). The log level is FATAL. This method will wait for the write to complete
func (Claims) Print ¶
Print send claims and the log message to alt4. The log level is NONE. Log message will be formatted by fmt.Sprint(a...)
func (Claims) Printf ¶
Printf send claims and the log message to alt4. The log level is NONE. Log message will be formatted by fmt.Sprintf(a...)
func (Claims) Println ¶
Println send claims and the log message to alt4. The log level is NONE. Log message will be formatted by fmt.Sprintln(a...)
func (Claims) Warning ¶
Warning send claims and the log message to alt4. The log level is WARNING. Log message will be formatted by fmt.Sprint(a...)
type GroupResult ¶
type GroupResult struct {
// contains filtered or unexported fields
}
GroupResult Object returned by creating a new log group/thread.
func Group ¶
func Group(v ...interface{}) *GroupResult
Group start a log group for the goroutine that calls this function. A group should be closed after. Use: `defer Group(...).Close()`
func (GroupResult) Close ¶
func (result GroupResult) Close(v ...interface{})
Close will mark the end of a thread closing the log group. If arguments are provided to the close function, they'll be logged. This can be useful for determining the latency of a request. If there were unfinished writes to alt4 during this thread. This method will wait for the writes to finish Close also logs any panic but doesn't recover.