logger

package
v1.4.0-beta Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package logger incapsulates logger functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppLogger added in v1.4.0

type AppLogger struct {
	// contains filtered or unexported fields
}

func Create added in v1.4.0

func Create(appPath, userSetLogLevel string) (*AppLogger, error)

Create - creates a new logger with a specific log level. appPath - where log file will be stored. userSetLogLevel - user-defined log level (debug or info).

func Get added in v1.4.0

func Get() *AppLogger

Get - returns application state.

func (*AppLogger) Close added in v1.4.0

func (l *AppLogger) Close()

func (*AppLogger) Debug added in v1.4.0

func (l *AppLogger) Debug(format string, args ...any)

func (*AppLogger) Error added in v1.4.0

func (l *AppLogger) Error(format string, args ...any)

func (*AppLogger) Info added in v1.4.0

func (l *AppLogger) Info(format string, args ...any)

func (*AppLogger) Warn added in v1.4.0

func (l *AppLogger) Warn(format string, args ...any)

type LogLevel added in v0.2.0

type LogLevel int

LogLevel is a subject for revising. Probably it's better to have a boolean flag to switch on/off debug logging.

const (
	// LevelDebug - when log level is 'debug', then all messages will be printed into the log file.
	LevelDebug LogLevel = iota
	// LevelInfo - when log level is 'info', then only 'info' messages will be printed into the log file.
	LevelInfo
)

Jump to

Keyboard shortcuts

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