log

package
v0.0.0-...-5886a04 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

func Debugf

func Debugf(format string, args ...interface{})

func Debugw

func Debugw(message string, args ...interface{})

func Error

func Error(args ...interface{})

func Errorf

func Errorf(format string, args ...interface{})

func Errorw

func Errorw(message string, args ...interface{})

func Fatal

func Fatal(args ...interface{})

func Fatalf

func Fatalf(format string, args ...interface{})

func Fatalw

func Fatalw(message string, args ...interface{})

func Info

func Info(args ...interface{})

func Infof

func Infof(format string, args ...interface{})

func Infow

func Infow(message string, args ...interface{})

func Init

func Init(opts *Options, fields ...logfields.Field)

func Panic

func Panic(args ...interface{})

func Panicf

func Panicf(format string, args ...interface{})

func Panicw

func Panicw(message string, args ...interface{})

func Sync

func Sync() error

func Warn

func Warn(args ...interface{})

func Warnf

func Warnf(format string, args ...interface{})

func Warnw

func Warnw(message string, args ...interface{})

func ZapLogger

func ZapLogger() *zap.Logger

Types

type FileOptions

type FileOptions struct {
	FileName   string `json:"file_name" yaml:"file_name"`
	MaxSize    int    `json:"max_size" yaml:"max_size"`
	MaxBackups int    `json:"max_backups" yaml:"max_backups"`
	MaxAge     int    `json:"max_age" yaml:"max_age"`
}

type Logger

type Logger interface {
	Debug(args ...interface{})
	Debugf(format string, args ...interface{})
	Debugw(message string, args ...interface{})

	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Infow(message string, args ...interface{})

	Warn(args ...interface{})
	Warnf(format string, args ...interface{})
	Warnw(message string, args ...interface{})

	Error(args ...interface{})
	Errorf(format string, args ...interface{})
	Errorw(message string, args ...interface{})

	Panic(args ...interface{})
	Panicf(format string, args ...interface{})
	Panicw(message string, args ...interface{})

	Fatal(args ...interface{})
	Fatalf(format string, args ...interface{})
	Fatalw(message string, args ...interface{})

	WithFields(keyValues map[string]interface{}) Logger
}

Logger is a contract for the logger

func DisableCaller

func DisableCaller() Logger

func NewLogger

func NewLogger(opts *Options) Logger

func WithFields

func WithFields(fields map[string]interface{}) Logger

type Options

type Options struct {
	File            *FileOptions `json:"file" yaml:"file"`
	ConsoleOutAsync bool         `json:"console_out_async" yaml:"console_out_async"`
	Level           string       `json:"level" yaml:"level"`
}

func NewOptions

func NewOptions() *Options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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