logger

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EOF_MSG   = "_EOF_MSG"
	EOF_KEY   = "_EOF_KEY"
	EOF_VALUE = "_EOF_VALUE"
)

Variables

This section is empty.

Functions

func RFC3339nanoTimeEncoder

func RFC3339nanoTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)

Types

type LogConfig

type LogConfig struct {
	// Logger Level
	Level string
	// Print log on console
	PrintLog bool
	// EncodeLogsAsJson makes the log framework log JSON
	EncodeLogsAsJson bool
	// FileLognodosagEnabled makes the framework log to a file
	// the fields below can be skipped if this value is false!
	FileLognodosagEnabled bool
	// Directory to log to to when filelognodosag is enabled
	Directory string
	// Filename is the name of the logfile which will be placed inside the directory
	Filename string
	// MaxSize the max size in MB of the logfile before it's rolled
	MaxSize int
	// MaxBackups the max number of rolled files to keep
	MaxBackups int
	// MaxAge the max age in days to keep a logfile
	MaxAge int
}

Configuration for lognodosag

type Logger

type Logger struct {
	*zap.SugaredLogger
	// contains filtered or unexported fields
}

func New

func New(filePath string) (l *Logger)

func Of

func Of(logName string) (l *Logger)

func (*Logger) Create

func (l *Logger) Create() *Logger

func (*Logger) CreateWithoutPool

func (l *Logger) CreateWithoutPool() *Logger

func (*Logger) DisableFile

func (l *Logger) DisableFile() *Logger

func (*Logger) OutputWriters

func (l *Logger) OutputWriters() []io.Writer

func (*Logger) SetAge

func (l *Logger) SetAge(days int) *Logger

func (*Logger) SetBufferLimit

func (l *Logger) SetBufferLimit(cacheLimit int) *Logger

func (*Logger) SetLevelDebug

func (l *Logger) SetLevelDebug()

func (*Logger) SetLevelError

func (l *Logger) SetLevelError()

func (*Logger) SetLevelInfo

func (l *Logger) SetLevelInfo()

func (*Logger) SetLevelWarn

func (l *Logger) SetLevelWarn()

func (*Logger) SetNumber

func (l *Logger) SetNumber(count int) *Logger

func (*Logger) SetSize

func (l *Logger) SetSize(mega int) *Logger

Jump to

Keyboard shortcuts

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