Documentation ¶
Index ¶
- Constants
- func Log(level Level, args ...interface{})
- func Logf(level Level, template string, args ...interface{})
- func SetLogLevel(level Level)
- func SetLoggerOutputConfig(conf LoggerOutputFileConf)
- func SetLoggerOutputType(outputType LoggerOutputType)
- type Fields
- type Level
- type LoggerOutputFileConf
- type LoggerOutputType
Examples ¶
Constants ¶
View Source
const ( LoggerOutputTypeStdOut = logapi.LoggerOutputTypeStdOut LoggerOutputTypeFile = logapi.LoggerOutputTypeFile )
View Source
const ( // PanicLevel level, highest level of severity. Logs and then calls panic with the // message passed to Debug, Info, ... PanicLevel = logapi.PanicLevel // FatalLevel level. Logs and then calls `logger.Exit(1)`. It will exit even if the // logging level is set to Panic. FatalLevel = logapi.FatalLevel // ErrorLevel level. Logs. Used for errors that should definitely be noted. // Commonly used for hooks to send errors to an error tracking service. ErrorLevel = logapi.ErrorLevel // WarnLevel level. Non-critical entries that deserve eyes. WarnLevel = logapi.WarnLevel // InfoLevel level. General operational entries about what's going on inside the // application. InfoLevel = logapi.InfoLevel // DebugLevel level. Usually only enabled when debugging. Very verbose logging. DebugLevel = logapi.DebugLevel // TraceLevel level. Designates finer-grained informational events than the Debug. TraceLevel = logapi.TraceLevel )
Variables ¶
This section is empty.
Functions ¶
func Log ¶
func Log(level Level, args ...interface{})
Log wrap level and field
Example ¶
package main import ( "github.com/commcos/utils/logger" ) func main() { logger.SetLogLevel(logger.TraceLevel) logger.Log(logger.InfoLevel, "url", "test") }
Output:
func SetLoggerOutputConfig ¶
func SetLoggerOutputConfig(conf LoggerOutputFileConf)
func SetLoggerOutputType ¶
func SetLoggerOutputType(outputType LoggerOutputType)
Types ¶
type LoggerOutputFileConf ¶
type LoggerOutputFileConf = logapi.LoggerOutputFileConf
type LoggerOutputType ¶
type LoggerOutputType = logapi.LoggerOutputType
Click to show internal directories.
Click to hide internal directories.