Documentation ¶
Overview ¶
Package logging provides utilities to easily set a universal log level, as well as intuitively set a log file.
Index ¶
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Debugln(args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Errorln(args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Fatalln(args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Infoln(args ...interface{})
- func SetLogFile(logFile io.Writer)
- func SetLogLevel(newLevel int)
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- func Warnln(args ...interface{})
- type LogLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf prints debug logs with a formatting directive.
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf prints error logs with a formatting directive.
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf prints a message with a formatting directive, then calls os.Exit(1).
func Fatalln ¶
func Fatalln(args ...interface{})
Fatalln prints a message and a new line, then calls os.Exit(1).
func Infof ¶
func Infof(format string, args ...interface{})
Infof prints info logs with a formatting directive.
func SetLogFile ¶
SetLogFile sets a file to write to in addition to standard output.
Types ¶
type LogLevel ¶
type LogLevel int
LogLevel indicates what to log based on the method called
const ( // LogLevelError is the log level that prints Panics, Fatals, and Errors. LogLevelError LogLevel = 0 // LogLevelWarning is the log level that prints Panics, Fatals, Errors, and Warnings. LogLevelWarning LogLevel = 1 // LogLevelInfo is the log level that prints Panics, Fatals, Errors, Warnings, and Infos. LogLevelInfo LogLevel = 2 // LogLevelDebug is the log level that prints Panics, Fatals, Errors, Warnings, Infos, and Debugs. LogLevelDebug LogLevel = 3 )
Click to show internal directories.
Click to hide internal directories.