Documentation ¶
Overview ¶
Package log exports logging primitives that log to stderr and also to Google Cloud Logging.
Index ¶
- Variables
- func At(level string) bool
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Flush()
- func GetLevel() string
- func NewStdLogger(l Logger) *log.Logger
- func Print(v ...interface{})
- func Printf(format string, v ...interface{})
- func Println(v ...interface{})
- func Register(e ExternalLogger)
- func SetLevel(level string) error
- func SetOutput(w io.Writer)
- type ExternalLogger
- type Level
- type Logger
Constants ¶
This section is empty.
Variables ¶
var ( Debug = &logger{DebugLevel} Info = &logger{InfoLevel} Error = &logger{ErrorLevel} )
The set of default loggers for each log level.
Functions ¶
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Fatalf writes a formatted message to the log and aborts.
func NewStdLogger ¶
NewStdLogger creates a *log.Logger ("log" is from the Go standard library) that forwards messages to the provided upspin logger using a logBridge. The standard logger is configured with log.Lshortfile, this log line format which is parsed to extract the log message (skipping the filename, line number) to forward it to the provided upspin logger.
func Printf ¶
func Printf(format string, v ...interface{})
Printf writes a formatted message to the log.
func Register ¶
func Register(e ExternalLogger)
Register connects an ExternalLogger to the default logger. This may only be called once.
Types ¶
type ExternalLogger ¶
ExternalLogger describes a service that processes logs.
type Logger ¶
type Logger interface { // Printf writes a formated message to the log. Printf(format string, v ...interface{}) // Print writes a message to the log. Print(v ...interface{}) // Println writes a line to the log. Println(v ...interface{}) // Fatal writes a message to the log and aborts. Fatal(v ...interface{}) // Fatalf writes a formated message to the log and aborts. Fatalf(format string, v ...interface{}) }
Logger is the interface for logging messages.