Documentation ¶
Index ¶
Constants ¶
View Source
const ( HookVendorFluentd = "fluentd" HookVendorLogstash = "logstash" )
View Source
const ( TraceLevel = Level(logrus.TraceLevel) DebugLevel = Level(logrus.DebugLevel) InfoLevel = Level(logrus.InfoLevel) WarnLevel = Level(logrus.WarnLevel) ErrorLevel = Level(logrus.ErrorLevel) FatalLevel = Level(logrus.FatalLevel) PanicLevel = Level(logrus.PanicLevel) )
View Source
const ( FieldKeyWallet = "wallet" FieldKeyModule = "module" FieldKeyCID = "cid" FieldKeyPrefix = "prefix" FieldKeyEID = "eid" )
View Source
const (
LogTimeLayout = "20060102-15:04:05.000000"
)
Variables ¶
View Source
var Must func(err error)
View Source
var Trace, Print, Debug, Info, Warn, Error, Panic, Fatal func(args ...interface{})
View Source
var Tracef, Printf, Debugf, Infof, Warnf, Errorf, Panicf, Fatalf func(format string, args ...interface{})
View Source
var Traceln, Println, Debugln, Infoln, Warnln, Errorln, Panicln, Fatalln func(args ...interface{})
Functions ¶
func AddForwarder ¶
func AddForwarder(c *ForwarderConfig) error
func SetGlobalLogger ¶
func SetGlobalLogger(logger Logger)
Types ¶
type ForwarderConfig ¶
type ForwarderConfig struct { Vendor string `json:"vendor"` Address string `json:"address"` Level string `json:"level"` Name string `json:"name"` TimeFormat string `json:"time_format,omitempty"` Options map[string]interface{} `json:"options,omitempty"` }
func (*ForwarderConfig) HookLevels ¶
func (c *ForwarderConfig) HookLevels() ([]logrus.Level, error)
func (*ForwarderConfig) NetworkAndHostPort ¶
func (c *ForwarderConfig) NetworkAndHostPort(defaultNet string) (network string, hostPort string, err error)
func (*ForwarderConfig) UnmarshalByOptions ¶
func (c *ForwarderConfig) UnmarshalByOptions(v interface{}) error
type HookCreater ¶
type HookCreater func(c *ForwarderConfig) (logrus.Hook, error)
type HookWrapper ¶
type HookWrapper struct {
// contains filtered or unexported fields
}
func (*HookWrapper) Levels ¶
func (h *HookWrapper) Levels() []logrus.Level
type Logger ¶
type Logger interface { Print(args ...interface{}) Printf(format string, args ...interface{}) Println(args ...interface{}) Trace(args ...interface{}) Tracef(format string, args ...interface{}) Traceln(args ...interface{}) Debug(args ...interface{}) Debugf(format string, args ...interface{}) Debugln(args ...interface{}) Info(args ...interface{}) Infof(format string, args ...interface{}) Infoln(args ...interface{}) Warn(args ...interface{}) Warnf(format string, args ...interface{}) Warnln(args ...interface{}) Error(args ...interface{}) Errorf(format string, args ...interface{}) Errorln(args ...interface{}) Panic(args ...interface{}) Panicf(format string, args ...interface{}) Panicln(args ...interface{}) Fatal(args ...interface{}) Fatalf(format string, args ...interface{}) Fatalln(args ...interface{}) Log(level Level, args ...interface{}) Logf(level Level, format string, args ...interface{}) Logln(level Level, args ...interface{}) Must(err error) WithFields(Fields) Logger SetReportCaller(yn bool) SetLevel(lv Level) GetLevel() Level SetConsoleLevel(lv Level) GetConsoleLevel() Level SetModuleLevel(mod string, lv Level) GetModuleLevel(mod string) Level Writer() *io.PipeWriter WriterLevel(lv Level) *io.PipeWriter SetFileWriter(writer io.Writer) error SetOutput(output io.Writer) // contains filtered or unexported methods }
func GlobalLogger ¶
func GlobalLogger() Logger
func WithFields ¶
Click to show internal directories.
Click to hide internal directories.