modulepackage
0.0.0-20231111115710-5bee1ffd82ce
Repository: https://github.com/tomhjx/xlog.git
Documentation: pkg.go.dev
# README
xlog
Logging library
# Functions
Background retrieves the fallback logger.
ClearLogger removes a backing Logger implementation if one was set earlier with SetLogger.
Error logs to the ERROR, WARNING, and INFO logs.
ErrorDepth acts as Error but uses depth to determine which call frame to log.
Errorf logs to the ERROR, WARNING, and INFO logs.
ErrorfDepth acts as Errorf but uses depth to determine which call frame to log.
Errorln logs to the ERROR, WARNING, and INFO logs.
ErrorlnDepth acts as Errorln but uses depth to determine which call frame to log.
ErrorS structured logs to the ERROR, WARNING, and INFO logs.
ErrorSDepth acts as ErrorS but uses depth to determine which call frame to log.
Fatal logs to the FATAL, ERROR, WARNING, and INFO logs, prints stack trace(s), then calls OsExit(255).
FatalDepth acts as Fatal but uses depth to determine which call frame to log.
Fatalf logs to the FATAL, ERROR, WARNING, and INFO logs, including a stack trace of all running goroutines, then calls OsExit(255).
FatalfDepth acts as Fatalf but uses depth to determine which call frame to log.
Fatalln logs to the FATAL, ERROR, WARNING, and INFO logs, including a stack trace of all running goroutines, then calls OsExit(255).
FatallnDepth acts as Fatalln but uses depth to determine which call frame to log.
Flush flushes all pending log I/O.
FlushAndExit flushes log data for a certain amount of time and then calls os.Exit.
FromContext retrieves a logger set by the caller or, if not set, falls back to the program's global logger (a Logger instance or xlog itself).
No description provided by the author
No description provided by the author
Info logs to the INFO log.
InfoDepth acts as Info but uses depth to determine which call frame to log.
Infof logs to the INFO log.
InfofDepth acts as Infof but uses depth to determine which call frame to log.
Infoln logs to the INFO log.
InfolnDepth acts as Infoln but uses depth to determine which call frame to log.
InfoS structured logs to the INFO log.
InfoSDepth acts as InfoS but uses depth to determine which call frame to log.
No description provided by the author
LoggerWithName returns logger.WithName(name) when contextual logging is enabled, otherwise the logger.
LoggerWithValues returns logger.WithValues(...kv) when contextual logging is enabled, otherwise the logger.
NewContext returns logr.NewContext(ctx, logger) when contextual logging is enabled, otherwise ctx.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
To remove a backing logr implemention, use ClearLogger.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TODO can be used as a last resort by code that has no means of receiving a logger from its caller.
No description provided by the author
Warning logs to the WARNING and INFO logs.
WarningDepth acts as Warning but uses depth to determine which call frame to log.
Warningf logs to the WARNING and INFO logs.
WarningfDepth acts as Warningf but uses depth to determine which call frame to log.
Warningln logs to the WARNING and INFO logs.
WarninglnDepth acts as Warningln but uses depth to determine which call frame to log.
# Variables
ExitFlushTimeout is the timeout that klog has traditionally used during calls like Fatal or Exit when flushing log data right before exiting.
New is an alias for logr.New.
OsExit is the function called by FlushAndExit to terminate the program.
# Type aliases
Level specifies a level of verbosity for V logs.
Logger in this package is exactly the same as logr.Logger.
LogSink in this package is exactly the same as logr.LogSink.
Runtimeinfo in this package is exactly the same as logr.RuntimeInfo.