Documentation ¶
Index ¶
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Debugw(msg string, kvs ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Errorw(msg string, kvs ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Fatalw(msg string, kvs ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Infow(msg string, kvs ...interface{})
- func Panic(args ...interface{})
- func Panicf(format string, args ...interface{})
- func Panicw(msg string, kvs ...interface{})
- func SetDefault(l *Logger)
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- func Warnw(msg string, kvs ...interface{})
- type Logger
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(args ...interface{})
Debug prints a debug-level log by default logger instance.
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf prints a debug-level log with format by default logger instance.
func Debugw ¶
func Debugw(msg string, kvs ...interface{})
Debugw prints a debug-level log with json-format by default logger instance.
func Error ¶
func Error(args ...interface{})
Error prints a error-level log by default logger instance.
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf prints a error-level log with format by default logger instance.
func Errorw ¶
func Errorw(msg string, kvs ...interface{})
Errorw prints a error-level log with json-format by default logger instance.
func Fatal ¶
func Fatal(args ...interface{})
Fatal prints a fatal-level log by default logger instance.
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf prints a fatal-level log with format by default logger instance.
func Fatalw ¶
func Fatalw(msg string, kvs ...interface{})
Fatalw prints a fatal-level log with json-format by default logger instance.
func Infof ¶
func Infof(format string, args ...interface{})
Infof prints a info-level log with format by default logger instance.
func Infow ¶
func Infow(msg string, kvs ...interface{})
Infow prints a info-level log with json-format by default logger instance.
func Panic ¶
func Panic(args ...interface{})
Panic prints a panic-level log by default logger instance.
func Panicf ¶
func Panicf(format string, args ...interface{})
Panicf prints a panic-level log with format by default logger instance.
func Panicw ¶
func Panicw(msg string, kvs ...interface{})
Panicw prints a panicw-level log with json-format by default logger instance.
Types ¶
type Logger ¶
type Logger struct { *zap.SugaredLogger // contains filtered or unexported fields }
Logger wraps zap.SugaredLogger with two output cores: a rotate file and color console. It also registers a custom metrics collection hook.
type Option ¶
type Option func(*Logger)
Option configures a logger.
func WithConsoleLog ¶
WithConsoleLog returns a Option that sets the logger's consoleLog field. If consoleLog equals to true, the logger will output log to console.
func WithFileLog ¶
WithFileLog returns a Option that sets the logger's fileLog field. If fileLog equals to true, the logger will output log to file.
func WithFilePath ¶
WithFilePath returns a Option that sets the logger's path field. path is file path of fileLog. It only takes effect when fileLog equals to true.