Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultErrorLogger is a default logger for Bucketeer SDK error logs. // For example, DefaultErrorLogger outputs, // [ERROR] 2021/01/01 10:00:00 message // // DefaultErrorLoger implements BaseLogger interface. DefaultErrorLogger = stdlog.New(os.Stderr, "[ERROR] ", flags) // DiscardErrorLogger discards all Bucketeer SDK error logs. // // DiscardErrorLoger implements BaseLogger interface. DiscardErrorLogger = stdlog.New(ioutil.Discard, "[ERROR] ", flags) )
Functions ¶
This section is empty.
Types ¶
type BaseLogger ¶
type BaseLogger interface { // Print outputs a message. // // Print is equivalent to log.Logger.Print in the standard library. Print(values ...interface{}) // Printf outputs a message, applying a format string. // // Printf is equivalent to log.Logger.Printf in the standard library. Printf(format string, values ...interface{}) }
BaseLogger is a generic logger interface with no level mechanism.
Since BaseLogger's methods are a subset of log.Logger in the standard library, you can use log.New() to create a BaseLogger, or you can implement a custom BaseLogger.
type Loggers ¶
type Loggers struct {
// contains filtered or unexported fields
}
Loggers is a logging compornent used in the Bucketeer SDK.
Debug logs are for Bucketeer SDK developers. Error logs are for Bucketeer SDK users.
type LoggersConfig ¶
type LoggersConfig struct { // EnableDebugLog enables debug logs if true. EnableDebugLog bool // ErrorLogger is used to output error logs. ErrorLogger BaseLogger }
LoggersConfig is the config for Loggers.
Click to show internal directories.
Click to hide internal directories.