Documentation ¶
Index ¶
- Constants
- func Debug(args ...interface{})
- func Debugf(template string, args ...interface{})
- func Debugw(msg string, keyvalues ...interface{})
- func Error(args ...interface{})
- func Errorf(template string, args ...interface{})
- func Errorw(err error, msg string)
- func Fatal(args ...interface{})
- func Fatalf(template string, args ...interface{})
- func FormatProto(arg protoreflect.ProtoMessage) string
- func Info(args ...interface{})
- func Infof(template string, args ...interface{})
- func Infow(msg string, keyvalues ...interface{})
- func Init(logLevel string, output string)
- func Logger() *zerolog.Logger
- func Monitor(msg string, args map[string]interface{})
- func SetFileErrorLog(path string) error
- func Warn(args ...interface{})
- func Warnf(template string, args ...interface{})
- func Warnw(msg string, keyvalues ...interface{})
Constants ¶
const ( LogLevelDebug = "debug" LogLevelInfo = "info" LogLevelWarn = "warn" LogLevelError = "error" )
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(template string, args ...interface{})
Debugf sends a formatted debug level log message
func Debugw ¶
func Debugw(msg string, keyvalues ...interface{})
Debugw sends a debug level log message with key-value pairs.
func Errorf ¶
func Errorf(template string, args ...interface{})
Errorf sends a formatted error level log message
func Fatalf ¶
func Fatalf(template string, args ...interface{})
Fatalf sends a formatted fatal level log message
func FormatProto ¶
func FormatProto(arg protoreflect.ProtoMessage) string
func Infof ¶
func Infof(template string, args ...interface{})
Infof sends a formatted info level log message
func Infow ¶
func Infow(msg string, keyvalues ...interface{})
Infow sends an info level log message with key-value pairs.
func Init ¶
Init initializes the logger. Output can be either "stdout/stderr/<filePath>". Log level can be "debug/info/warn/error".
func Monitor ¶ added in v1.4.0
Monitor is a wrapper around Info that allows passing a map of key-value pairs. This is useful for structured logging and monitoring. The caller information is skipped.
func SetFileErrorLog ¶
SetFileErrorLog if set writes the Warning and Error messages to a file.
Types ¶
This section is empty.