Documentation ¶
Index ¶
- Constants
- Variables
- func Debug(format string, v ...interface{})
- func Error(format string, v ...interface{})
- func Fatal(format string, v ...interface{})
- func Info(format string, v ...interface{})
- func Init(cfg *Config)
- func InitElastic(cfg *ElasticConfig) error
- func Log(level int, format string, v ...interface{})
- func LogElastic(level int, format string, v ...interface{})
- func LogStdout(level int, format string, v ...interface{})
- func Warn(format string, v ...interface{})
- type Config
- type ElasticConfig
- type Logger
Constants ¶
View Source
const ( FATAL = 0 ERROR = 1 WARN = 2 INFO = 3 DEBUG = 4 )
Variables ¶
View Source
var Identifier string = fmt.Sprintf("%d|%s", pid, processName)
View Source
var Level int = INFO
View Source
var LogLevelName []string = []string{"FATAL", "ERROR", "WARN", "INFO", "DEBUG"}
Functions ¶
func InitElastic ¶
func InitElastic(cfg *ElasticConfig) error
func LogElastic ¶
Types ¶
type Config ¶ added in v0.0.3
type Config struct { Level int `mapstructure:"level" json:"level" yaml:"level"` Identifier string `mapstructure:"identifier" json:"identifier" yaml:"identifier"` Elastic struct { Addresses []string `mapstructure:"addresses" json:"addresses" yaml:"addresses"` Username string `mapstructure:"username" json:"username" yaml:"username"` Password string `mapstructure:"password" json:"password" yaml:"password"` CAFingerprint string `mapstructure:"ca" json:"ca" yaml:"ca"` Index string `mapstructure:"index" json:"index" yaml:"index"` } `mapstructure:"elastic" json:"elastic" yaml:"elastic"` Methods struct { LvFatal string `mapstructure:"fatal" json:"fatal" yaml:"fatal"` LvError string `mapstructure:"error" json:"error" yaml:"error"` LvWarn string `mapstructure:"warn" json:"warn" yaml:"warn"` LvInfo string `mapstructure:"info" json:"info" yaml:"info"` LvDebug string `mapstructure:"debug" json:"debug" yaml:"debug"` } `mapstructure:"methods" json:"methods" yaml:"methods"` }
type ElasticConfig ¶
Click to show internal directories.
Click to hide internal directories.