logger

package
v0.2.24 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	// IsDebug is used to determine whether to emit debug logs.
	IsDebug bool

	// IsQuiet is used to determine whether to emit non-critical logs.
	IsQuiet bool
	// contains filtered or unexported fields
}

Logger is a wrapper around log.Logger with the following features:

  • Supports a prefix
  • Adds colors to the output
  • Debug mode (all logs, debug and above)
  • Quiet mode (only critical logs)

func GetLogger

func GetLogger(isDebug bool, prefix string) *Logger

GetLogger Returns a logger.

func GetQuietLogger

func GetQuietLogger(prefix string) *Logger

GetQuietLogger Returns a logger that only emits critical logs. Useful for anti-cheat stages.

func (*Logger) Criticalf

func (l *Logger) Criticalf(fstring string, args ...interface{})

Criticalf is to be used only in anti-cheat stages

func (*Logger) Criticalln

func (l *Logger) Criticalln(msg string)

Criticalln is to be used only in anti-cheat stages

func (*Logger) Debugf

func (l *Logger) Debugf(fstring string, args ...interface{})

func (*Logger) Debugln

func (l *Logger) Debugln(msg string)

func (*Logger) Errorf

func (l *Logger) Errorf(fstring string, args ...interface{})

func (*Logger) Errorln

func (l *Logger) Errorln(msg string)

func (*Logger) Infof

func (l *Logger) Infof(fstring string, args ...interface{})

func (*Logger) Infoln

func (l *Logger) Infoln(msg string)

func (*Logger) Plainf added in v0.2.22

func (l *Logger) Plainf(fstring string, args ...interface{})

func (*Logger) Plainln

func (l *Logger) Plainln(msg string)

func (*Logger) Successf

func (l *Logger) Successf(fstring string, args ...interface{})

func (*Logger) Successln

func (l *Logger) Successln(msg string)

Jump to

Keyboard shortcuts

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