vlog

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugLevel = zapcore.DebugLevel
	InfoLevel  = zapcore.InfoLevel
	WarnLevel  = zapcore.WarnLevel
	ErrorLevel = zapcore.ErrorLevel
	FatalLevel = zapcore.FatalLevel
)

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, args ...any)

func Debugc

func Debugc(ctx context.Context, msg string, args ...any)

func Debugf

func Debugf(msg string, args ...any)

func Error

func Error(msg string, args ...any)

func Errorc

func Errorc(ctx context.Context, msg string, args ...any)

func Errorf

func Errorf(msg string, args ...any)

func Fatal

func Fatal(msg string, args ...any)

func Fatalc

func Fatalc(ctx context.Context, msg string, args ...any)

func Fatalf

func Fatalf(msg string, args ...any)

func Info

func Info(msg string, args ...any)

func Infoc

func Infoc(ctx context.Context, msg string, args ...any)

func Infof

func Infof(msg string, args ...any)

func Warn

func Warn(msg string, args ...any)

func Warnc

func Warnc(ctx context.Context, msg string, args ...any)

func Warnf

func Warnf(msg string, args ...any)

Types

type Log

type Log struct {
	Logger  *zap.SugaredLogger
	Options *Options
}

func GetLog

func GetLog() *Log

func New

func New(options map[string]any) (*Log, error)

func SetConfig

func SetConfig(options map[string]any) (*Log, error)

func (*Log) SetConfig

func (log *Log) SetConfig(options map[string]any) (*Log, error)

type Options

type Options struct {
	Compress         bool
	File             string        // log file
	Level            zapcore.Level // log level
	MaxAge           int           // retention days
	MaxBackups       int           // MaxBackups is the maximum number of old log files to retain.
	MaxSize          int           // MaxSize is the maximum size in megabytes of the log file before it gets rotated. File size in MB
	OutputMode       OutputMode
	OutputFormatMode OutputFormatMode
}

type OutputFormatMode

type OutputFormatMode uint
const (
	OutputFormatModeText OutputFormatMode = iota
	OutputFormatModeJson
)

type OutputMode

type OutputMode uint
const (
	OutputModeConsole OutputMode = iota
	OutputModeFile
	OutputModeConsoleAndFile
)

Jump to

Keyboard shortcuts

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