Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Debug = log.Print
Debug is called to write debug logs, such as logging request parameter to see what is coming inside.
var Debugf = log.Printf
Debugf is called to write debug logs, such as logging request parameter to see what is coming inside.
var ErrNotInitialized = errors.New("flog: structure logging should be initialized first")
ErrNotInitialized is returned when structured logging is not enabled
var Error = log.Print
Error is called to write an error log, such as when a new connection fails.
var Errorf = log.Printf
Errorf is called to write an error log, such as when a new connection fails.
var Fatal = log.Fatal
Fatal is called to write an error log and then exit with non-zero status code. It cannot be disabled.
var Fatalf = log.Fatalf
Fatalf is called to write an error log and then exit with non-zero status code. It cannot be disabled.
var Info = log.Print
Info is called to write informational logs, such as when startup has
var Infof = log.Printf
Infof is called to write informational logs, such as when startup has
var Infow = log.Printf
Infow is called to write informational logs, but as key value pairs.
var Verbose = log.Print
Verbose is called to write verbose logs, such as when a new connection is established correctly.
var Verbosef = log.Printf
Verbosef is called to write verbose logs, such as when a new connection is established correctly.
var Warn = log.Print
Warn is called to write an error log that can be ignored.
var Warnf = log.Printf
Warnf is called to write an error log that can be ignored.
Functions ¶
func InitializeSructuredLogs ¶
InitializeSructuredLogs replaces all logging functions with structured logging variants.
func LogDebugToStdout ¶
func LogDebugToStdout()
LogDebugToStdout updates Verbosef and Info logging to use stdout instead of stderr.
func LogVerboseToNowhere ¶
func LogVerboseToNowhere()
LogVerboseToNowhere updates Verbosef so verbose log messages are discarded
func SugaredLogger ¶
func SugaredLogger() (*zap.SugaredLogger, error)
SugaredLogger returns the initialized sugared logger
Types ¶
type Config ¶
type Config struct { // LogDebugStdout logs to stdout instead of stderr LogDebugStdout bool // Verbose enables verbose logging. Verbose bool // Debug enables debug logging. Debug bool // Human enable human readable logging. // Good for development. Human bool }
Config configures flog structured logging.