Documentation ¶
Index ¶
Constants ¶
const ( // LevelUndefined is the erroneous value of log-level which corresponds // to zero-value. LevelUndefined = internal.LevelUndefined // LevelFatal will report about Fatalf-s only. LevelFatal = internal.LevelFatal // LevelPanic will report about Panicf-s and Fatalf-s only. LevelPanic = internal.LevelPanic // LevelError will report about Errorf-s, Panicf-s, ... LevelError = internal.LevelError // LevelWarning will report about Warningf-s, Errorf-s, ... LevelWarning = internal.LevelWarning // LevelInfo will report about Infof-s, Warningf-s, ... LevelInfo = internal.LevelInfo // LevelDebug will report about Debugf-s, Infof-s, ... LevelDebug = internal.LevelDebug // EndOfLevel is just used as a limiter for `for`-s. EndOfLevel )
Variables ¶
This section is empty.
Functions ¶
func RegisterAdapter ¶
func RegisterAdapter(adapter Adapter)
RegisterAdapter registers an Adapter to be used by ConvertLogger.
Types ¶
type Adapter ¶
type Adapter interface {
Convert(backend interface{}) Logger
}
Adapter defines an adapter to convert a logger to Logger.
type Level ¶
Level is used to define severity of messages to be reported.
func ParseLogLevel ¶
ParseLogLevel parses incoming string into a Level and returns LevelUndefined with an error if an unknown logging level was passed.
type Logger ¶
Logger is the interface of a logger provided by an extended context.
This is the complete logger with all the required methods/features.
func ConvertLogger ¶
func ConvertLogger(logger interface{}) Logger
ConvertLogger converts arbitrary logger to Logger. If it was unable to then it returns a nil.
To enable logadapter-s for this converter add imports, for example:
import _ "github.com/facebookincubator/contest/pkg/xcontext/logger/logadapter/logrus" import _ "github.com/facebookincubator/contest/pkg/xcontext/logger/logadapter/zap"
type MinimalLogger ¶
type MinimalLogger = internal.MinimalLogger
MinimalLogger is the interfaces of a logger without contextual methods.