logger

package
v0.0.0-...-64d6ff4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultPath  string = "/var/log/k8shuginn/"
	LogExtension string = ".log"
)
View Source
const (
	DefaultDir string = "log"
)

Variables

This section is empty.

Functions

func Debug

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

Debug logs a message at DebugLevel. The message includes any fields passed

func Error

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

Error logs a message at ErrorLevel. The message includes any fields passed

func Fatal

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

Fatal logs a message at FatalLevel. The message includes any fields passed

func Info

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

Info logs a message at InfoLevel. The message includes any fields passed

func Panic

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

Panic logs a message at PanicLevel. The message includes any fields passed

func SetLogger

func SetLogger(name string, opts ...Option)

SetLogger initializes the global logger

func TestSetLogger

func TestSetLogger()

func Warn

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

Warn logs a message at WarnLevel. The message includes any fields passed

Types

type Option

type Option func(*config)

Option is a function that modifies a configuration

func WithLogCompress

func WithLogCompress(compress bool) Option

WithLogCompress sets the compression for the log file

func WithLogLevel

func WithLogLevel(level string) Option

WithLogLevel sets the log level for the logger

func WithLogLocalTime

func WithLogLocalTime(localTime bool) Option

WithLogLocalTime sets the local time for the log file

func WithLogMaxAge

func WithLogMaxAge(age int) Option

WithLogMaxAge sets the maximum age of the log file

func WithLogMaxBackups

func WithLogMaxBackups(count int) Option

WithLogMaxBackups sets the maximum number of backups for the log file

func WithLogMaxSize

func WithLogMaxSize(size int) Option

WithLogMaxSize sets the maximum size of the log file

func WithLogPath

func WithLogPath(path string) Option

WithLogPath sets the path for the log file

Jump to

Keyboard shortcuts

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