logger

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(logSettings *Settings)

Init initializes the global logger with the given settings.

func New

func New(logSettings *Settings) *mlog.Logger

New returns a newly created and initialized logger with the given settings.

Types

type Settings

type Settings struct {
	EnableConsole bool   `default:"true"`
	ConsoleJson   bool   `default:"false"`
	ConsoleLevel  string `default:"ERROR" validate:"oneof:{TRACE, DEBUG, INFO, WARN, ERROR}"`
	EnableFile    bool   `default:"true"`
	FileJson      bool   `default:"false"`
	FileLevel     string `default:"ERROR" validate:"oneof:{TRACE, DEBUG, INFO, WARN, ERROR}"`
	FileLocation  string `default:"loadtest.log"`
	EnableColor   bool   `default:"false"`
}

Settings holds information used to initialize a new logger.

Jump to

Keyboard shortcuts

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