Documentation ¶
Index ¶
- func CtxDebugf(ctx context.Context, format string, v ...interface{})
- func CtxErrorf(ctx context.Context, format string, v ...interface{})
- func CtxFatalf(ctx context.Context, format string, v ...interface{})
- func CtxInfof(ctx context.Context, format string, v ...interface{})
- func CtxNoticef(ctx context.Context, format string, v ...interface{})
- func CtxTracef(ctx context.Context, format string, v ...interface{})
- func CtxWarnf(ctx context.Context, format string, v ...interface{})
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Notice(v ...interface{})
- func Noticef(format string, v ...interface{})
- func SetLevel(lv Level)
- func SetLogger(v FullLogger)
- func SetOutput(w io.Writer)
- func Trace(v ...interface{})
- func Tracef(format string, v ...interface{})
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- type Control
- type CtxLogger
- type FormatLogger
- type FullLogger
- type Level
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CtxNoticef ¶
CtxNoticef calls the default logger's CtxNoticef method.
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf calls the default logger's Debugf method.
func Errorf ¶
func Errorf(format string, v ...interface{})
Errorf calls the default logger's Errorf method.
func Fatal ¶
func Fatal(v ...interface{})
Fatal calls the default logger's Fatal method and then os.Exit(1).
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Fatalf calls the default logger's Fatalf method and then os.Exit(1).
func Infof ¶
func Infof(format string, v ...interface{})
Infof calls the default logger's Infof method.
func Noticef ¶
func Noticef(format string, v ...interface{})
Noticef calls the default logger's Noticef method.
func SetLevel ¶
func SetLevel(lv Level)
SetLevel sets the level of logs below which logs will not be output. The default log level is LevelTrace. Note that this method is not concurrent-safe.
func SetLogger ¶
func SetLogger(v FullLogger)
SetLogger sets the default logger. Note that this method is not concurrent-safe and must not be called after the use of DefaultLogger and global functions in this package.
Types ¶
type CtxLogger ¶
type CtxLogger interface { CtxTracef(ctx context.Context, format string, v ...interface{}) CtxDebugf(ctx context.Context, format string, v ...interface{}) CtxInfof(ctx context.Context, format string, v ...interface{}) CtxNoticef(ctx context.Context, format string, v ...interface{}) CtxWarnf(ctx context.Context, format string, v ...interface{}) CtxErrorf(ctx context.Context, format string, v ...interface{}) CtxFatalf(ctx context.Context, format string, v ...interface{}) }
CtxLogger is a logger interface that accepts a context argument and output logs with a format.
type FormatLogger ¶
type FormatLogger interface { Tracef(format string, v ...interface{}) Debugf(format string, v ...interface{}) Infof(format string, v ...interface{}) Noticef(format string, v ...interface{}) Warnf(format string, v ...interface{}) Errorf(format string, v ...interface{}) Fatalf(format string, v ...interface{}) }
FormatLogger is a logger interface that output logs with a format.
type FullLogger ¶
type FullLogger interface { Logger FormatLogger CtxLogger Control }
FullLogger is the combination of Logger, FormatLogger, CtxLogger and Control.
func DefaultLogger ¶
func DefaultLogger() FullLogger
DefaultLogger return the default logger for hertz.