logger

package
v0.0.0-...-c097f9c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

L is the global logger instance

Functions

func Close

func Close() error

Close closes the logger and releases resources

func Debug

func Debug(msg string, fields ...zap.Field)

Debug logs a message at DebugLevel

func Error

func Error(msg string, fields ...zap.Field)

Error logs a message at ErrorLevel

func Fatal

func Fatal(msg string, fields ...zap.Field)

Fatal logs a message at FatalLevel

func Info

func Info(msg string, fields ...zap.Field)

Info logs a message at InfoLevel

func Init

func Init(opts *Options) error

Init simplified initialization function

func Sync

func Sync() error

Sync flushes any buffered log entries

func Warn

func Warn(msg string, fields ...zap.Field)

Warn logs a message at WarnLevel

func With

func With(fields ...zap.Field) *zap.Logger

With creates a logger with additional fields

Types

type Options

type Options struct {
	Level         string `mapstructure:"level"`
	Format        string `mapstructure:"format"`
	Filename      string `mapstructure:"filename"`
	MaxSize       int    `mapstructure:"max-size"`
	MaxBackups    int    `mapstructure:"max-backups"`
	MaxAge        int    `mapstructure:"max-age"`
	Compress      bool   `mapstructure:"compress"`
	EnableConsole bool   `mapstructure:"enable-console"`
}

Options simplified configuration options

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions returns the default configuration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL