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 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 ¶
View Source
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 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.
Click to show internal directories.
Click to hide internal directories.