Documentation
¶
Overview ¶
Package logging contains project logging functions
Index ¶
- Constants
- type CallerHook
- type Logger
- type ZLogger
- func (l *ZLogger) Bytes(key string, value []byte) Logger
- func (l ZLogger) Clone() Logger
- func (l ZLogger) Debug(args ...interface{})
- func (l ZLogger) Debugf(format string, args ...interface{})
- func (l ZLogger) Error(args ...interface{})
- func (l ZLogger) Errorf(format string, args ...interface{})
- func (l ZLogger) Fatal(args ...interface{})
- func (l ZLogger) Fatalf(format string, args ...interface{})
- func (l *ZLogger) Fields(fields map[string]interface{}) Logger
- func (l ZLogger) Info(args ...interface{})
- func (l ZLogger) Infof(format string, args ...interface{})
- func (l *ZLogger) Int(key string, value int) Logger
- func (l *ZLogger) Int64(key string, value int64) Logger
- func (l *ZLogger) Interface(key string, value interface{}) Logger
- func (l *ZLogger) Level(s string) (Logger, error)
- func (l *ZLogger) String(key, value string) Logger
- func (l ZLogger) Warning(args ...interface{})
- func (l ZLogger) Warningf(format string, args ...interface{})
Constants ¶
View Source
const ( // ModuleFieldName is tag for module name in log output ModuleFieldName = "module" // FileFieldName is tag for file name in log output FileFieldName = "file" // PackageFieldName is tag for package name in log output PackageFieldName = "package" // FuncFieldName is tag for func name in log output FuncFieldName = "func" // DefaultTimeFormat is time format DefaultTimeFormat = "2006-01-02 15:04:05.000" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface {
Debug(args ...interface{})
Debugf(format string, args ...interface{})
Info(args ...interface{})
Infof(format string, args ...interface{})
Error(args ...interface{})
Errorf(format string, args ...interface{})
Fatal(args ...interface{})
Fatalf(format string, args ...interface{})
Warning(args ...interface{})
Warningf(format string, args ...interface{})
// Structured logging methods, use to add context fields
String(key, value string) Logger
Int(key string, value int) Logger
Int64(key string, value int64) Logger
Interface(key string, value interface{}) Logger
Bytes(key string, value []byte) Logger
Fields(fields map[string]interface{}) Logger
// Get child logger with the minimum accepted level
Level(string) (Logger, error)
// Returns new copy of log, when need to avoid context duplication
Clone() Logger
}
Logger implements logger abstraction.
type ZLogger ¶
ZLogger is implementation of zerolog logger
func ConfigureLog ¶
ConfigureLog creates new logger based on github.com/rs/zerolog package
func (ZLogger) Debug ¶
func (l ZLogger) Debug(args ...interface{})
Debug prints message for debug level
func (ZLogger) Error ¶
func (l ZLogger) Error(args ...interface{})
Error prints message for error level
func (ZLogger) Fatal ¶
func (l ZLogger) Fatal(args ...interface{})
Fatal prints message for fatal level
Click to show internal directories.
Click to hide internal directories.