Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultMessageFormat = "\t${Level}\t${Log}\t${Message}\t${Context}" DefaultTimeFormat = "2006-01-02 15:04:05" )
Variables ¶
This section is empty.
Functions ¶
func TestModule ¶
func TestModule(m *di.Module)
Types ¶
type Level ¶
type Level int
func (Level) MarshalJSON ¶
UnmarshalJSON implements the json.Marshaler interface.
func (Level) MarshalYAML ¶
func (*Level) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*Level) UnmarshalYAML ¶
type Log ¶
type Log interface { Print(ctx context.Context, level Level, v ...interface{}) Printf(ctx context.Context, level Level, f string, v ...interface{}) Trace(ctx context.Context, v ...interface{}) Tracef(ctx context.Context, f string, v ...interface{}) Debug(ctx context.Context, v ...interface{}) Debugf(ctx context.Context, f string, v ...interface{}) Info(ctx context.Context, v ...interface{}) Infof(ctx context.Context, f string, v ...interface{}) Warn(ctx context.Context, v ...interface{}) Warnf(ctx context.Context, f string, v ...interface{}) Error(ctx context.Context, v ...interface{}) Errorf(ctx context.Context, f string, v ...interface{}) Stack(ctx context.Context, v ...interface{}) Stackf(ctx context.Context, f string, v ...interface{}) Fatal(ctx context.Context, v ...interface{}) Fatalf(ctx context.Context, f string, v ...interface{}) }
type LoggerConfig ¶
type LoggerConfig struct { Type LoggerType `yaml:"type"` Level Level `yaml:"level"` Message string `yaml:"format"` Time string `yaml:"time_format"` Context []string `yaml:"context"` // File logger File string `yaml:"file"` // File path. FileMaxSize int `yaml:"file_max_size"` // Maximum size in megabytes of a log file. FileMaxAge int `yaml:"file_max_age"` // Maximum number of days to retain old log files. FileMaxBackups int `yaml:"file_max_backups"` // Maximum number of old log files to retain. }
type LoggerType ¶
type LoggerType string
const ( LoggerTypeDefault LoggerType = "" LoggerTypeConsole LoggerType = "console" LoggerTypeFile LoggerType = "file" )
Click to show internal directories.
Click to hide internal directories.