Documentation ¶
Overview ¶
Refer:
https://github.com/go-eden/slf4go https://github.com/go-eden/slf4go-zap
Index ¶
- Constants
- func DPanic(args ...interface{})
- func DPanicf(template string, args ...interface{})
- func DPanicw(msg string, keysAndValues ...interface{})
- func Debug(args ...interface{})
- func Debugf(template string, args ...interface{})
- func Debugw(msg string, keysAndValues ...interface{})
- func Error(args ...interface{})
- func Errorf(template string, args ...interface{})
- func Errorw(msg string, keysAndValues ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(template string, args ...interface{})
- func Fatalw(msg string, keysAndValues ...interface{})
- func Info(args ...interface{})
- func Infof(template string, args ...interface{})
- func Infow(msg string, keysAndValues ...interface{})
- func Init(opts *Options) error
- func Level() string
- func Mode() string
- func Panic(args ...interface{})
- func Panicf(template string, args ...interface{})
- func Panicw(msg string, keysAndValues ...interface{})
- func SetDriver(driver driver.Driver)
- func Warn(args ...interface{})
- func Warnf(template string, args ...interface{})
- func Warnw(msg string, keysAndValues ...interface{})
- type Logger
- func (l *Logger) DPanic(args ...interface{})
- func (l *Logger) DPanicf(format string, args ...interface{})
- func (l *Logger) DPanicw(msg string, keysAndValues ...interface{})
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Debugw(msg string, keysAndValues ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Errorw(msg string, keysAndValues ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Fatalf(format string, args ...interface{})
- func (l *Logger) Fatalw(msg string, keysAndValues ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) Infow(msg string, keysAndValues ...interface{})
- func (l *Logger) Panic(args ...interface{})
- func (l *Logger) Panicf(format string, args ...interface{})
- func (l *Logger) Panicw(msg string, keysAndValues ...interface{})
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) Warnf(format string, args ...interface{})
- func (l *Logger) Warnw(msg string, keysAndValues ...interface{})
- 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 ...interface{})
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
func DPanicf(template string, args ...interface{})
DPanicf uses fmt.Sprintf to log a templated message. In development, the logger then panics. (See DPanicLevel for details.)
func DPanicw ¶ added in v0.10.6
func DPanicw(msg string, keysAndValues ...interface{})
DPanicw logs a message with some additional context.
func Debug ¶ added in v0.10.6
func Debug(args ...interface{})
Debug uses fmt.Sprint to construct and log a message.
func Debugf ¶ added in v0.10.6
func Debugf(template string, args ...interface{})
Debugf uses fmt.Sprintf to log a templated message.
func Debugw ¶ added in v0.10.6
func Debugw(msg string, keysAndValues ...interface{})
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 ...interface{})
Error uses fmt.Sprint to construct and log a message.
func Errorf ¶ added in v0.10.6
func Errorf(template string, args ...interface{})
Errorf uses fmt.Sprintf to log a templated message.
func Errorw ¶ added in v0.10.6
func Errorw(msg string, keysAndValues ...interface{})
Errorw logs a message with some additional context.
func Fatal ¶ added in v0.10.6
func Fatal(args ...interface{})
Fatal uses fmt.Sprint to construct and log a message, then calls os.Exit.
func Fatalf ¶ added in v0.10.6
func Fatalf(template string, args ...interface{})
Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit.
func Fatalw ¶ added in v0.10.6
func Fatalw(msg string, keysAndValues ...interface{})
Fatalw logs a message with some additional context.
func Info ¶ added in v0.10.6
func Info(args ...interface{})
Info uses fmt.Sprint to construct and log a message.
func Infof ¶ added in v0.10.6
func Infof(template string, args ...interface{})
Infof uses fmt.Sprintf to log a templated message.
func Infow ¶ added in v0.10.6
func Infow(msg string, keysAndValues ...interface{})
Infow logs a message with some additional context.
func Panic ¶ added in v0.10.6
func Panic(args ...interface{})
Panic uses fmt.Sprint to construct and log a message, then panics.
func Panicf ¶ added in v0.10.6
func Panicf(template string, args ...interface{})
Panicf uses fmt.Sprintf to log a templated message, then panics.
func Panicw ¶ added in v0.10.6
func Panicw(msg string, keysAndValues ...interface{})
Panicw logs a message with some additional context.
func Warn ¶ added in v0.10.6
func Warn(args ...interface{})
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 ...interface{}) // Info uses fmt.Sprint to construct and log a message. Info(args ...interface{}) // Warn uses fmt.Sprint to construct and log a message. Warn(args ...interface{}) // Error uses fmt.Sprint to construct and log a message. Error(args ...interface{}) // DPanic uses fmt.Sprint to construct and log a message. In development, the // logger then panics. (See DPanicLevel for details.) DPanic(args ...interface{}) // Panic uses fmt.Sprint to construct and log a message, then panics. Panic(args ...interface{}) // Fatal uses fmt.Sprint to construct and log a message, then calls os.Exit. Fatal(args ...interface{}) // Debugf uses fmt.Sprintf to log a templated message. Debugf(format string, args ...interface{}) // Infof uses fmt.Sprintf to log a templated message. Infof(format string, args ...interface{}) // Warnf uses fmt.Sprintf to log a templated message. Warnf(format string, args ...interface{}) // Errorf uses fmt.Sprintf to log a templated message. Errorf(format string, args ...interface{}) // DPanicf uses fmt.Sprintf to log a templated message. In development, the // logger then panics. (See DPanicLevel for details.) DPanicf(format string, args ...interface{}) // Panicf uses fmt.Sprintf to log a templated message, then panics. Panicf(format string, args ...interface{}) // Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit. Fatalf(format string, args ...interface{}) }
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 }