Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // IsTerm instructs current stdout whether is terminal IsTerm bool // LogAccess is log access log LogAccess *logrus.Logger // LogError is log error log LogError *logrus.Logger )
View Source
var DefaultConfig = &Config{ Format: "string", AccessLog: "stdout", AccessLevel: "info", ErrorLog: "stderr", ErrorLevel: "error", Agent: AgentConfig{ Enabled: false, }, }
DefaultConfig is default configuration
Functions ¶
func SetLogLevel ¶
SetLogLevel is define log level what you want log level: panic, fatal, error, warn, info and debug
Types ¶
type AgentConfig ¶
type AgentConfig struct { Enabled bool `yaml:"enabled"` DSN string `yaml:"dsn"` AppID string `yaml:"app_id"` Host string `yaml:"host"` InstanceID string `yaml:"instance_id"` Category string `yaml:"category"` ChannelSize int `yaml:"channel_size,omitempty"` }
AgentConfig is sub section of LogConfig.
type Config ¶
type Config struct { Format string `yaml:"format"` AccessLog string `yaml:"access_log"` AccessLevel string `yaml:"access_level"` ErrorLog string `yaml:"error_log"` ErrorLevel string `yaml:"error_level"` Agent AgentConfig `yaml:"agent"` }
Config is logging config.
type EmptyFormatter ¶
type EmptyFormatter struct { }
EmptyFormatter output nothing
func NewEmptyFormatter ¶
func NewEmptyFormatter() *EmptyFormatter
NewEmptyFormatter return the log format for output nothing
Click to show internal directories.
Click to hide internal directories.