package
9.1.81+incompatible
Repository: https://github.com/pinpt/go-common.git
Documentation: pkg.go.dev

# Functions

Debug log helper.
DeleteLogFile will delete the log file.
Error log helper.
Fatal log helper.
Info log helper.
LevelFromString will return a LogLevel const from a named string.
MaskKV will mask a map of strings to strings and that and weather or not it changed anything.
NewCommandLogger returns a new Logger for a given command.
NewLogger will create a new logger.
NewNoOpTestLogger is a test logger that doesn't log at all.
NewRandomLogPath will define a random log path in the env, it does not create a logfile, just a path.
NewWrappedLogCloser returns a new instance of WrappedLogCloser.
RegisterFlags will register the flags for logging.
Warn log helper.
With returns a new contextual logger with keyvals prepended to those passed to calls to Log.
WithBackgroundLogger will return a logger which will collect log file and call the callback upon exit with the name of the logfile for further processing when the process is completed.
WithCrashLogger will tell the logger to create a logfile and log to it, in the event of a crash it will send the logfile to our analytics api.
WithDefaultTimestampLogOption will add the timestamp using layout format provided.

# Constants

ConsoleLogFormat will output logfmt colored logs to console.
DarkLogColorTheme is the default color theme for console logging (if enabled).
DebugLevel will log all messages.
ErrorLevel will only log error and above.
InfoLevel will only log level and above (default).
JSONLogFormat will output JSON formatted logs.
LightLogColorTheme is for consoles that are light (vs dark).
LogFmtLogFormat will output logfmt formatted logs.
NoColorTheme will turn off console colors.
NoneLevel will no log at all.
WarnLevel will only log warning and above.

# Variables

ErrLogQueueFull will return when the log queue is full.
ErrMissingValue is appended to keyvals slices with odd length to substitute the missing value.
~10kb.
TerminationLogPath is the path to the termination log if running inside a container.

# Structs

WrappedLogCloser wraps a logger and its delegate.

# Interfaces

Logger is the fundamental interface for all log operations.
LoggerCloser returns a logger which implements a Close interface.

# Type aliases

BackgroundLoggerCallback is a callback function that will get invoked when the log needs to be fetched.
ColorTheme is the logging color theme.
Level is the minimum logging level.
OutputFormat is the logging output format.
WithLogOptions is a callback for customizing the logger event further before returning.