Documentation
¶
Index ¶
- Variables
- type DefaultLogger
- func (d *DefaultLogger) Critical(header, subheader string, details *[]string)
- func (d *DefaultLogger) Debug(header, subheader string, details *[]string)
- func (d *DefaultLogger) Error(header, subheader string, errors *[]error)
- func (d *DefaultLogger) Info(header, subheader string, details *[]string)
- func (d *DefaultLogger) Log(message *gologger.Message)
- func (d *DefaultLogger) RunIfShouldLog(status gologgerstatus.Status, fn func())
- func (d *DefaultLogger) ShouldLog(status gologgerstatus.Status) bool
- func (d *DefaultLogger) Warning(header, subheader string, details *[]string)
- type Logger
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // LogModeMap is the map of the log mode LogModeMap = map[goflagsmode.Mode]map[gologgerstatus.Status]bool{ goflagsmode.Debug: { gologgerstatus.Info: true, gologgerstatus.Error: true, gologgerstatus.Warning: true, gologgerstatus.Debug: true, gologgerstatus.Critical: true, }, goflagsmode.Dev: { gologgerstatus.Info: true, gologgerstatus.Error: true, gologgerstatus.Warning: true, gologgerstatus.Debug: false, gologgerstatus.Critical: true, }, goflagsmode.Prod: { gologgerstatus.Info: true, gologgerstatus.Error: true, gologgerstatus.Warning: true, gologgerstatus.Debug: false, gologgerstatus.Critical: true, }, } )
Functions ¶
This section is empty.
Types ¶
type DefaultLogger ¶
type DefaultLogger struct {
// contains filtered or unexported fields
}
DefaultLogger is the default mode logger
func NewDefaultLogger ¶
func NewDefaultLogger(logger gologger.Logger) ( *DefaultLogger, error, )
NewDefaultLogger creates a new default mode logger
func (*DefaultLogger) Critical ¶
func (d *DefaultLogger) Critical(header, subheader string, details *[]string)
Critical logs a critical message
func (*DefaultLogger) Debug ¶
func (d *DefaultLogger) Debug(header, subheader string, details *[]string)
Debug logs a debug message
func (*DefaultLogger) Error ¶
func (d *DefaultLogger) Error(header, subheader string, errors *[]error)
Error logs an error message
func (*DefaultLogger) Info ¶
func (d *DefaultLogger) Info(header, subheader string, details *[]string)
Info logs an info message
func (*DefaultLogger) Log ¶
func (d *DefaultLogger) Log(message *gologger.Message)
Log logs a message
func (*DefaultLogger) RunIfShouldLog ¶
func (d *DefaultLogger) RunIfShouldLog( status gologgerstatus.Status, fn func(), )
RunIfShouldLog runs the function if the log should be logged
func (*DefaultLogger) ShouldLog ¶
func (d *DefaultLogger) ShouldLog(status gologgerstatus.Status) bool
ShouldLog checks if the log should be logged
func (*DefaultLogger) Warning ¶
func (d *DefaultLogger) Warning(header, subheader string, details *[]string)
Warning logs a warning message
type Logger ¶
type Logger interface { ShouldLog(status gologgerstatus.Status) bool RunIfShouldLog(status gologgerstatus.Status, fn func()) gologger.Logger }
Logger interface for the mode logger
Click to show internal directories.
Click to hide internal directories.