Documentation
¶
Index ¶
- type Logger
- func (l *Logger) Clone() *Logger
- func (l *Logger) Criticalf(fstring string, args ...any)
- func (l *Logger) Criticalln(msg string)
- func (l *Logger) Debugf(fstring string, args ...any)
- func (l *Logger) Debugln(msg string)
- func (l *Logger) Errorf(fstring string, args ...any)
- func (l *Logger) Errorln(msg string)
- func (l *Logger) GetLastSecondaryPrefix() string
- func (l *Logger) GetSecondaryPrefixes() []string
- func (l *Logger) Infof(fstring string, args ...any)
- func (l *Logger) Infoln(msg string)
- func (l *Logger) Plainf(fstring string, args ...any)
- func (l *Logger) Plainln(msg string)
- func (l *Logger) PopSecondaryPrefix() string
- func (l *Logger) PushSecondaryPrefix(prefix string)
- func (l *Logger) ResetSecondaryPrefixes()
- func (l *Logger) Successf(fstring string, args ...any)
- func (l *Logger) Successln(msg string)
- func (l *Logger) UpdateLastSecondaryPrefix(newPrefix string)
- func (l *Logger) UpdateSecondaryPrefixes(prefixes []string)
- func (l *Logger) WithAdditionalSecondaryPrefix(prefix string, fn func())
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)
- Serialized writes for all loggers in this package
func GetQuietLogger ¶
GetQuietLogger Returns a logger that only emits critical logs. Useful for anti-cheat stages.
func (*Logger) Criticalln ¶
Criticalln is to be used only in anti-cheat stages
func (*Logger) GetLastSecondaryPrefix ¶
GetLastSecondaryPrefix returns the last secondary prefix
func (*Logger) GetSecondaryPrefixes ¶
GetSecondaryPrefix returns all the secondary prefixes
func (*Logger) PopSecondaryPrefix ¶
PopSecondaryPrefix removes the secondary prefix from the top of secondaryPrefixes
func (*Logger) PushSecondaryPrefix ¶
PushSecondaryPrefix pushes a new secondary prefix to secondaryPrefixes
func (*Logger) ResetSecondaryPrefixes ¶
func (l *Logger) ResetSecondaryPrefixes()
ResetSecondaryPrefixes clears all secondary prefixes
func (*Logger) UpdateLastSecondaryPrefix ¶
UpdateLastSecondaryPrefix updates the secondary prefix at the top of SecondaryPrefixes stack
func (*Logger) UpdateSecondaryPrefixes ¶
UpdateSecondaryPrefixes replaces all secondary prefixes with the new one
func (*Logger) WithAdditionalSecondaryPrefix ¶
WithAddtionalSecondaryPrefix is helpful you want to run one or more logging statements using an additional secondary prefix