logger

package
v0.1.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogConfig

type LogConfig struct {
	Filename     string
	MaxSize      int // megabytes
	MaxAge       int // days
	MaxBackups   int
	Compress     bool
	ClearOnStart bool
}

type Logger

type Logger interface {
	Info(msg string, keysAndValues ...interface{})
	Error(msg string, keysAndValues ...interface{})
	Warn(msg string, keysAndValues ...interface{})
	Debug(msg string, keysAndValues ...interface{})
	Fatal(msg string, keysAndValues ...interface{})
	Close() error
}

Logger is the interface that defines the logging methods

func New

func New(config LogConfig, quietMode bool) (Logger, error)

New creates a new Logger instance

type ZapLogger

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

ZapLogger is the concrete implementation of the Logger interface

func (*ZapLogger) Close

func (l *ZapLogger) Close() error

func (*ZapLogger) Debug

func (l *ZapLogger) Debug(msg string, keysAndValues ...interface{})

func (*ZapLogger) Error

func (l *ZapLogger) Error(msg string, keysAndValues ...interface{})

func (*ZapLogger) Fatal

func (l *ZapLogger) Fatal(msg string, keysAndValues ...interface{})

func (*ZapLogger) Info

func (l *ZapLogger) Info(msg string, keysAndValues ...interface{})

func (*ZapLogger) Warn

func (l *ZapLogger) Warn(msg string, keysAndValues ...interface{})

Jump to

Keyboard shortcuts

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