package log
import "github.com/cloudflare/cfssl/log"
Package log implements a wrapper around the Go standard library's logging package. Clients should set the current log level; only messages below that level will actually be logged. For example, if Level is set to LevelWarning, only log messages at the Warning, Error, and Critical levels will be logged.
Index ¶
- Constants
- Variables
- func Critical(v ...interface{})
- func Criticalf(format string, v ...interface{})
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func SetLogger(logger SyslogWriter)
- func Warning(v ...interface{})
- func Warningf(format string, v ...interface{})
- type SyslogWriter
Constants ¶
const ( // LevelDebug is the log level for Debug statements. LevelDebug = iota // LevelInfo is the log level for Info statements. LevelInfo // LevelWarning is the log level for Warning statements. LevelWarning // LevelError is the log level for Error statements. LevelError // LevelCritical is the log level for Critical statements. LevelCritical // LevelFatal is the log level for Fatal statements. LevelFatal )
The following constants represent logging levels in increasing levels of seriousness.
Variables ¶
var Level = LevelInfo
Level stores the current logging level.
Functions ¶
func Critical ¶
func Critical(v ...interface{})
Critical logs its arguments at the "critical" level.
func Criticalf ¶
func Criticalf(format string, v ...interface{})
Criticalf logs a formatted message at the "critical" level. The arguments are handled in the same manner as fmt.Printf.
func Debug ¶
func Debug(v ...interface{})
Debug logs its arguments at the "debug" level.
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf logs a formatted message at the "debug" level. The arguments are handled in the same manner as fmt.Printf.
func Error ¶
func Error(v ...interface{})
Error logs its arguments at the "error" level.
func Errorf ¶
func Errorf(format string, v ...interface{})
Errorf logs a formatted message at the "error" level. The arguments are handled in the same manner as fmt.Printf.
func Fatal ¶
func Fatal(v ...interface{})
Fatal logs its arguments at the "fatal" level and then exits.
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Fatalf logs a formatted message at the "fatal" level and then exits. The arguments are handled in the same manner as fmt.Printf.
func Info ¶
func Info(v ...interface{})
Info logs its arguments at the "info" level.
func Infof ¶
func Infof(format string, v ...interface{})
Infof logs a formatted message at the "info" level. The arguments are handled in the same manner as fmt.Printf.
func SetLogger ¶
func SetLogger(logger SyslogWriter)
SetLogger sets the output used for output by this package. A *syslog.Writer is a good choice for the logger parameter. Call with a nil parameter to revert to default behavior.
func Warning ¶
func Warning(v ...interface{})
Warning logs its arguments at the "warning" level.
func Warningf ¶
func Warningf(format string, v ...interface{})
Warningf logs a formatted message at the "warning" level. The arguments are handled in the same manner as fmt.Printf.
Types ¶
type SyslogWriter ¶
type SyslogWriter interface { Debug(string) Info(string) Warning(string) Err(string) Crit(string) Emerg(string) }
SyslogWriter specifies the necessary methods for an alternate output destination passed in via SetLogger.
SyslogWriter is satisfied by *syslog.Writer.
Source Files ¶
- Version
- v1.6.5 (latest)
- Published
- Mar 5, 2024
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 6 days ago –
Tools for package owners.