# README
⚠️ Deprecated: use log/slog
instead ⚠️
package log
Package log implements a simple level logging package that maintains API
compatibility with the standard library log
package. It extends the standard
library log.Logger
type with a Level
type that can be used to define output
verbosity. It adds additional methods that will be printed only if the logger
is configured at or below a given level. For example:
package main
import "github.com/subpop/go-log"
func main() {
log.SetLevel(log.LevelWarn)
log.Traceln("Messages at LevelTrace will not print if the Level is Warn")
log.Warnln("Messages at LevelTrace will print with the Level set to Warn")
}
# Packages
No description provided by the author
# Functions
CurrentLevel returns the output level for the standard logger.
Debug prints to the standard logger if level is at least LevelDebug.
Debugf prints to the standard logger if level is at least LevelDebug.
Debugln prints to the standard logger if level is at least LevelDebug.
Error prints to the standard logger if level is at least LevelError.
Errorf prints to the standard logger if level is at least LevelError.
Errorln prints to the standard logger if level is at least LevelError.
Fatal is equivalent to Print() followed by a call to os.Exit(1).
Fatalf is equivalent to Printf() followed by a call to os.Exit(1).
Fatalln is equivalent to Println() followed by a call to os.Exit(1).
Flags returns the output flags for the standard logger.
FormatLevel converts the Level to a string.
Info prints to the standard logger if level is at least LevelInfo.
Infof prints to the standard logger if level is at least LevelInfo.
Infoln prints to the standard logger if level is at least LevelInfo.
New creates a new Logger.
Output wraps a call to the standard logger's Output function for API compatibility.
Panic is equivalent to Print() followed by a call to panic().
Panicf is equivalent to Printf() followed by a call to panic().
Panicln is equivalent to Println() followed by a call to panic().
ParseLevel returns the Level value represented by the string.
Prefix returns the output prefix for the standard logger.
Print calls Print to print to the standard logger.
Printf calls Printf to print to the standard logger.
Println calls Println to print to the standard logger.
SetFlags sets the output flags for the standard logger.
SetLevel sets the output level for the standard logger.
SetOutput sets the output destination for the standard logger.
SetPrefix sets the output prefix for the standard logger.
Trace prints to the standard logger if level is at least LevelTrace.
Tracef prints to the standard logger if level is at least LevelTrace.
Traceln prints to the standard logger if level is at least LevelTrace.
Warn prints to the standard logger if level is at least LevelWarn.
Warnf prints to the standard logger if level is at least LevelWarn.
Warnln prints to the standard logger if level is at least LevelWarn.
Writer returns the output destination for the standard logger.
# Constants
These flags define which text to prefix to each log entry generated by the Logger.
LevelError is the default level.
LevelError is the default level.
LevelError is the default level.
LevelError is the default level.
LevelError is the default level.
LevelError is the default level.
These flags define which text to prefix to each log entry generated by the Logger.
These flags define which text to prefix to each log entry generated by the Logger.
These flags define which text to prefix to each log entry generated by the Logger.
These flags define which text to prefix to each log entry generated by the Logger.
These flags define which text to prefix to each log entry generated by the Logger.
These flags define which text to prefix to each log entry generated by the Logger.
# Structs
A Logger represents a standard library Logger, configured for output at a given verbosity level.
# Type aliases
Level defines various levels of logging output.
A ParseError occurs when a string value cannot be parsed to a valid level.