log

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

README

github.com/AlvinRamoutar/go-framework/log

Configurable logging module

Documentation

Index

Constants

This section is empty.

Variables

View Source
var VERSION string = "0.0.1"

Functions

This section is empty.

Types

type Log

type Log struct {
	Create *zerolog.Logger
	Config *LogConfig
	// contains filtered or unexported fields
}

func (*Log) AsyncStart

func (l *Log) AsyncStart() error

func (*Log) Init

func (l *Log) Init(config *LogConfig) error

func (*Log) Reload

func (l *Log) Reload(logConfig *LogConfig) error

func (*Log) Restart

func (l *Log) Restart() error

func (*Log) Start

func (l *Log) Start() error

func (*Log) Status

func (l *Log) Status() (string, error)

func (*Log) Stop

func (l *Log) Stop() error

func (*Log) Version

func (l *Log) Version() string

type LogConfig

type LogConfig struct {
	LogLevel              int    `yaml:"loglevel"`
	ConsoleLoggingEnabled bool   `yaml:"consoleloggingenabled"`
	EncodeLogsAsJson      bool   `yaml:"encodelogasjson"`
	FileLoggingEnabled    bool   `yaml:"fileloggingenabled"`
	FileLoggingDirectory  string `yaml:"fileloggingdirectory"`
	FileLoggingFilename   string `yaml:"fileloggingfilename"`
	FileLoggingMaxSize    int    `yaml:"fileloggingmaxsize"`
	FileLoggingMaxBackups int    `yaml:"fileloggingmaxbackups"`
	FileLoggingMaxAge     int    `yaml:"fileloggingmaxage"`
}

func (*LogConfig) GetLogLevel

func (l *LogConfig) GetLogLevel() zerolog.Level

panic (zerolog.PanicLevel, 5) fatal (zerolog.FatalLevel, 4) error (zerolog.ErrorLevel, 3) warn (zerolog.WarnLevel, 2) info (zerolog.InfoLevel, 1) debug (zerolog.DebugLevel, 0) trace (zerolog.TraceLevel, -1)

func (*LogConfig) New

func (l *LogConfig) New() *LogConfig

Jump to

Keyboard shortcuts

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