Documentation ¶
Index ¶
- func GetZapLogLevel(logLevel string) zapcore.Level
- type DefaultLogger
- func (l *DefaultLogger) Debug(msg string, fields ...zapcore.Field)
- func (l *DefaultLogger) Error(msg string, fields ...zapcore.Field)
- func (l *DefaultLogger) Fatal(msg string, fields ...zapcore.Field)
- func (l *DefaultLogger) Info(msg string, fields ...zapcore.Field)
- func (l *DefaultLogger) Panic(msg string, fields ...zapcore.Field)
- func (l *DefaultLogger) Sync() error
- func (l *DefaultLogger) Warn(msg string, fields ...zapcore.Field)
- func (l *DefaultLogger) With(fields ...zapcore.Field) *DefaultLogger
- type Logger
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetZapLogLevel ¶
GetZapLogLevel returns zap.AtomicLevel from string.
Types ¶
type DefaultLogger ¶ added in v1.2.0
type DefaultLogger struct {
// contains filtered or unexported fields
}
DefaultLogger delegates all calls to the underlying zap.Logger.
func (*DefaultLogger) Debug ¶ added in v1.2.0
func (l *DefaultLogger) Debug(msg string, fields ...zapcore.Field)
Debug logs a debug msg with fields.
func (*DefaultLogger) Error ¶ added in v1.2.0
func (l *DefaultLogger) Error(msg string, fields ...zapcore.Field)
Error logs an error msg with fields.
func (*DefaultLogger) Fatal ¶ added in v1.2.0
func (l *DefaultLogger) Fatal(msg string, fields ...zapcore.Field)
Fatal logs a fatal error msg with fields and panics. Apps will have to recover if ever needed.
func (*DefaultLogger) Info ¶ added in v1.2.0
func (l *DefaultLogger) Info(msg string, fields ...zapcore.Field)
Info logs an info msg with fields.
func (*DefaultLogger) Panic ¶ added in v1.2.0
func (l *DefaultLogger) Panic(msg string, fields ...zapcore.Field)
Panic logs a fatal error msg and fields and panics. Apps will have to recover if ever needed.
func (*DefaultLogger) Sync ¶ added in v1.2.0
func (l *DefaultLogger) Sync() error
Sync call zap.Logger Sync() method.
func (*DefaultLogger) Warn ¶ added in v1.2.0
func (l *DefaultLogger) Warn(msg string, fields ...zapcore.Field)
Warn logs an warning msg with fields.
func (*DefaultLogger) With ¶ added in v1.2.0
func (l *DefaultLogger) With(fields ...zapcore.Field) *DefaultLogger
With creates a child logger, and optionally adds some context fields to that logger.
type Logger ¶
type Logger interface { Debug(msg string, fields ...zapcore.Field) Info(msg string, fields ...zapcore.Field) Warn(msg string, fields ...zapcore.Field) Error(msg string, fields ...zapcore.Field) Fatal(msg string, fields ...zapcore.Field) Panic(msg string, fields ...zapcore.Field) }
Logger is a simplified abstraction of the zap.Logger.
type Option ¶
type Option func(*DefaultLogger)
Option type.
func WithZapOption ¶
WithZapOption add fields.Service.