Documentation
¶
Overview ¶
Refer:
https://github.com/go-eden/slf4go https://github.com/go-eden/slf4go-zap
Index ¶
- Constants
- func DPanic(args ...any)
- func DPanicf(template string, args ...any)
- func DPanicw(msg string, keysAndValues ...any)
- func Debug(args ...any)
- func Debugf(template string, args ...any)
- func Debugw(msg string, keysAndValues ...any)
- func Error(args ...any)
- func Errorf(template string, args ...any)
- func Errorw(msg string, keysAndValues ...any)
- func Fatal(args ...any)
- func Fatalf(template string, args ...any)
- func Fatalw(msg string, keysAndValues ...any)
- func Info(args ...any)
- func Infof(template string, args ...any)
- func Infow(msg string, keysAndValues ...any)
- func Init(opts *Options) error
- func Level() string
- func LevelEnabled(lvl zapcore.Level) bool
- func Mode() string
- func Panic(args ...any)
- func Panicf(template string, args ...any)
- func Panicw(msg string, keysAndValues ...any)
- func SetDriver(driver driver.Driver)
- func Warn(args ...any)
- func Warnf(template string, args ...any)
- func Warnw(msg string, keysAndValues ...any)
- type Logger
- func (l *Logger) DPanic(args ...any)
- func (l *Logger) DPanicf(format string, args ...any)
- func (l *Logger) DPanicw(msg string, keysAndValues ...any)
- func (l *Logger) Debug(args ...any)
- func (l *Logger) Debugf(format string, args ...any)
- func (l *Logger) Debugw(msg string, keysAndValues ...any)
- func (l *Logger) Error(args ...any)
- func (l *Logger) Errorf(format string, args ...any)
- func (l *Logger) Errorw(msg string, keysAndValues ...any)
- func (l *Logger) Fatal(args ...any)
- func (l *Logger) Fatalf(format string, args ...any)
- func (l *Logger) Fatalw(msg string, keysAndValues ...any)
- func (l *Logger) Info(args ...any)
- func (l *Logger) Infof(format string, args ...any)
- func (l *Logger) Infow(msg string, keysAndValues ...any)
- func (l *Logger) Panic(args ...any)
- func (l *Logger) Panicf(format string, args ...any)
- func (l *Logger) Panicw(msg string, keysAndValues ...any)
- func (l *Logger) Warn(args ...any)
- func (l *Logger) Warnf(format string, args ...any)
- func (l *Logger) Warnw(msg string, keysAndValues ...any)
- type LoggerIface
- type Options
Constants ¶
const ( ModeSimple = "SIMPLE" ModeFull = "FULL" )
Variables ¶
This section is empty.
Functions ¶
func DPanic ¶ added in v0.10.6
func DPanic(args ...any)
DPanic uses fmt.Sprint to construct and log a message. In development, the logger then panics. (See DPanicLevel for details.)
func DPanicf ¶ added in v0.10.6
DPanicf uses fmt.Sprintf to log a templated message. In development, the logger then panics. (See DPanicLevel for details.)
func Debug ¶ added in v0.10.6
func Debug(args ...any)
Debug uses fmt.Sprint to construct and log a message.
func Debugw ¶ added in v0.10.6
Debugw logs a message with some additional context. The variadic key-value pairs are treated as they are in With.
func Error ¶ added in v0.10.6
func Error(args ...any)
Error uses fmt.Sprint to construct and log a message.
func Fatal ¶ added in v0.10.6
func Fatal(args ...any)
Fatal uses fmt.Sprint to construct and log a message, then calls os.Exit.
func Fatalf ¶ added in v0.10.6
Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit.
func Info ¶ added in v0.10.6
func Info(args ...any)
Info uses fmt.Sprint to construct and log a message.
func LevelEnabled ¶ added in v0.15.0
func Panic ¶ added in v0.10.6
func Panic(args ...any)
Panic uses fmt.Sprint to construct and log a message, then panics.
func Warn ¶ added in v0.10.6
func Warn(args ...any)
Warn uses fmt.Sprint to construct and log a message.
Types ¶
type Logger ¶ added in v0.10.6
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) Debugw ¶ added in v0.10.6
Debugw logs a message with some additional context. The variadic key-value pairs are treated as they are in With.
type LoggerIface ¶ added in v0.10.6
type LoggerIface interface {
// Debug uses fmt.Sprint to construct and log a message.
Debug(args ...any)
// Info uses fmt.Sprint to construct and log a message.
Info(args ...any)
// Warn uses fmt.Sprint to construct and log a message.
Warn(args ...any)
// Error uses fmt.Sprint to construct and log a message.
Error(args ...any)
// DPanic uses fmt.Sprint to construct and log a message. In development, the
// logger then panics. (See DPanicLevel for details.)
DPanic(args ...any)
// Panic uses fmt.Sprint to construct and log a message, then panics.
Panic(args ...any)
// Fatal uses fmt.Sprint to construct and log a message, then calls os.Exit.
Fatal(args ...any)
// Debugf uses fmt.Sprintf to log a templated message.
Debugf(format string, args ...any)
// Infof uses fmt.Sprintf to log a templated message.
Infof(format string, args ...any)
// Warnf uses fmt.Sprintf to log a templated message.
Warnf(format string, args ...any)
// Errorf uses fmt.Sprintf to log a templated message.
Errorf(format string, args ...any)
// DPanicf uses fmt.Sprintf to log a templated message. In development, the
// logger then panics. (See DPanicLevel for details.)
DPanicf(format string, args ...any)
// Panicf uses fmt.Sprintf to log a templated message, then panics.
Panicf(format string, args ...any)
// Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit.
Fatalf(format string, args ...any)
}
type Options ¶ added in v0.10.6
type Options struct {
// Log mode: SIMPLE, FULL.
//
// Default: "FULL".
Mode string
// Log level: DEBUG, INFO, WARN, ERROR.
//
// Default: "INFO".
Level string
// Log filename: set this if you want to write log messages to files.
//
// Default: "".
Filename string
// Log sink: CONSOLE, FILE, and MULTI.
//
// Default: "CONSOLE".
Sink string
}