package
1.0.0
Repository: https://github.com/didi/gatekeeper.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
Package diode provides a thread-safe, lock-free, non-blocking io.Writer wrapper.
Package hlog provides a set of http.Handler helpers for zerolog.
No description provided by the author
Package log provides a global logger for zerolog.

# Functions

Arr creates an array to be added to an Event or Context.
Ctx returns the Logger associated with the ctx.
DisableSampling will disable sampling in all Loggers if true.
GlobalLevel returns the current global log level.
MultiLevelWriter creates a writer that duplicates its writes to all the provided writers, similar to the Unix tee(1) command.
New creates a root logger with given output writer.
NewFileWriter creates and initializes a new AccessWriter.
NewConsoleWriter creates and initializes a new ConsoleWriter.
NewFileWriter creates and initializes a new AccessWriter.
NewLevelHook returns a new LevelHook.
NewStdoutWriter will write to stdout.
NewFileWriter creates and initializes a new AccessWriter.
Nop returns a disabled logger for which all operation are no-op.
ParseLevel converts a level string into a zerolog Level value.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SetGlobalLevel sets the global override for log level.
SyncWriter wraps w so that each call to Write is synchronized with a mutex.
SyslogLevelWriter wraps a SyslogWriter and call the right syslog level method matching the zerolog level.

# Constants

DebugLevel defines debug log level.
Disabled disables the logger.
ErrorLevel defines error log level.
FatalLevel defines fatal log level.
InfoLevel defines info log level.
NoLevel defines an absent log level.
PanicLevel defines panic log level.
WarnLevel defines warn log level.

# Variables

CallerFieldName is the field name used for caller field.
CallerSkipFrameCount is the number of stack frames to skip to find the caller.
DurationFieldInteger renders Dur fields as integer instead of float if set to true.
DurationFieldUnit defines the unit for time.Duration type fields added using the Dur method.
ErrorFieldName is the field name used for error fields.
ErrorHandler is called whenever zerolog fails to write an event on its output.
ErrorMarshalFunc allows customization of global error marshaling.
LevelFieldName is the field name used for the level field.
MessageFieldName is the field name used for the message field.
Often samples log every ~ 10 events.
Rarely samples log every ~ 1000 events.
Sometimes samples log every ~ 100 events.
TimeFieldFormat defines the time format of the Time field type.
TimestampFieldName is the field name used for the timestamp field.
TimestampFunc defines the function called to generate a timestamp.

# Structs

No description provided by the author
Array is used to prepopulate an array of items which can be re-used to add to log messages.
BasicSampler is a sampler that will send every Nth events, regardless of there level.
BurstSampler lets Burst events pass per Period then pass the decision to NextSampler.
ConsoleWriter parses the JSON input and writes it in an (optionally) colorized, human-friendly format to Out.
Context configures a new sub-logger with contextual fields.
Event represents a log event.
No description provided by the author
LevelHook applies a different hook for each level.
LevelSampler applies a different sampler for each level.
A Logger represents an active logging object that generates lines of JSON output to an io.Writer.
No description provided by the author
No description provided by the author

# Interfaces

FormatWriter define format method.
Hook defines an interface to a log hook.
LevelWriter defines as interface a writer may implement in order to receive level information with payload.
Sampler defines an interface to a log sampler.
SyslogWriter is an interface matching a syslog.Writer struct.

# Type aliases

Formatter transforms the input into a formatted string.
HookFunc is an adaptor to allow the use of an ordinary function as a Hook.
Level defines log levels.
No description provided by the author
RandomSampler use a PRNG to randomly sample an event out of N events, regardless of their level.