Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Log is global logger Log *zap.Logger Sugar *zap.SugaredLogger LogLevel Level )
Functions ¶
Types ¶
type Context ¶
type Context map[string]interface{}
func (Context) NewError ¶
func (c Context) NewError(err interface{}, lvl Level) ContextError
type ContextError ¶
type Level ¶
type Level struct {
// contains filtered or unexported fields
}
Level holds the logging level. It can be set either via integers [-1,,5] or via the associated string names: Debug(-1), Info(0), Warn(1), Error(2), DPanic(3), Panic(4), Fatal(5). Default: Info(0)
func New ¶
New creates a new logging Level from a string input.
Allowed inputs: [Debug, Info, Warn, Error, DPanic, Panic, Fatal]. All other inputs will result in log Level Debug.
func NewFromInt ¶
// NewFromInt creates a new logging Level. // // Available levels: [Debug(-1), Info(0), Warn(1), Error(2), DPanic(3), Panic(4), Fatal(5)]. // Inputs larger than 5 will result in Level Fatal(5). // Inputs smaller than -1 will result in Level Debug(-1).
func (Level) AllLevels ¶
AllLevels returns a printed map of all possible logging inputs (keys and values are valid inputs)
func (Level) Print ¶
String returns the Logging Level in string form with integer form in parentheses