Documentation ¶
Index ¶
- Constants
- func Debug(args ...any)
- func Debugf(format string, args ...any)
- func Error(args ...any)
- func Errorf(format string, args ...any)
- func Fatal(args ...any)
- func Fatalf(format string, args ...any)
- func Info(args ...any)
- func Infof(format string, args ...any)
- func Init(opts ...Option) error
- func InitLogger(opts ...Option)
- func Log(level string, v ...any)
- func Logf(level string, format string, v ...any)
- func Warn(args ...any)
- func Warnf(format string, args ...any)
- type Logger
- type Option
- type Options
- type Rotation
Constants ¶
View Source
const ( DebugLevel = "debug" InfoLevel = "info" WarnLevel = "warn" ErrorLevel = "error" PanicLevel = "panic" FatalLevel = "fatal" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger interface { // Init initializes options Init(options ...Option) error // Fields set fields to always be logged Fields(fields map[string]any) Logger // Log writes a log entry Log(level string, v ...any) // Logf writes a formatted log entry Logf(level string, format string, v ...any) }
Logger is a generic logging interface.
func NewExampleLogger ¶
func NewExampleLogger() Logger
NewExampleLogger builds a Logger that's designed for use in zap's testable
type Option ¶
type Option func(*Options)
func WithCallerSkipCount ¶
func WithDisableConsole ¶
func WithDisableConsole() Option
func WithFields ¶
func WithJsonEncoding ¶
func WithJsonEncoding() Option
func WithLogDir ¶
func WithRotation ¶
Click to show internal directories.
Click to hide internal directories.