package log
import "github.com/rs/zerolog/log"
Package log provides a global logger for zerolog.
Index ¶
- Variables
- func Ctx(ctx context.Context) zerolog.Logger
- func Debug() *zerolog.Event
- func Error() *zerolog.Event
- func Fatal() *zerolog.Event
- func Info() *zerolog.Event
- func Level(level zerolog.Level) zerolog.Logger
- func Log() *zerolog.Event
- func Panic() *zerolog.Event
- func Sample(every int) zerolog.Logger
- func Warn() *zerolog.Event
- func With() zerolog.Context
Variables ¶
Logger is the global logger.
Functions ¶
func Ctx ¶
Ctx returns the Logger associated with the ctx. If no logger is associated, a disabled logger is returned.
func Debug ¶
Debug starts a new message with debug level.
You must call Msg on the returned event in order to send the event.
func Error ¶
Error starts a new message with error level.
You must call Msg on the returned event in order to send the event.
func Fatal ¶
Fatal starts a new message with fatal level. The os.Exit(1) function is called by the Msg method.
You must call Msg on the returned event in order to send the event.
func Info ¶
Info starts a new message with info level.
You must call Msg on the returned event in order to send the event.
func Level ¶
Level crestes a child logger with the minium accepted level set to level.
func Log ¶
Log starts a new message with no level. Setting zerolog.GlobalLevel to zerlog.Disabled will still disable events produced by this method.
You must call Msg on the returned event in order to send the event.
func Panic ¶
Panic starts a new message with panic level. The message is also sent to the panic function.
You must call Msg on the returned event in order to send the event.
func Sample ¶
Sample returns a logger that only let one message out of every to pass thru.
func Warn ¶
Warn starts a new message with warn level.
You must call Msg on the returned event in order to send the event.
func With ¶
With creates a child logger with the field added to its context.
Source Files ¶
- Version
- v1.0.2
- Published
- Jul 26, 2017
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 3 days ago –
Tools for package owners.