Documentation ¶
Index ¶
- Constants
- Variables
- type Logger
- func (log *Logger) Debugf(template string, args ...interface{})
- func (log *Logger) Errorf(template string, args ...interface{})
- func (log *Logger) Fatalf(template string, args ...interface{})
- func (log *Logger) Infof(template string, args ...interface{})
- func (log *Logger) Log(v ...interface{}) error
- func (log *Logger) SetLevel(lvl int)
- func (log *Logger) Tracef(template string, args ...interface{})
- func (log *Logger) Warnf(template string, args ...interface{})
- type Option
Constants ¶
View Source
const ( LogFieldService = "service" LogFieldHostname = "hostname" )
Variables ¶
View Source
var StdLogger = New()
Functions ¶
This section is empty.
Types ¶
type Logger ¶
Logger represents a logger that embeds zerolog
func NewFromZerolog ¶
NewFromZerolog returns a new logger from an existing zerolog instance
type Option ¶
type Option func(c *config)
Options is an config setting function
func WithCaller ¶
func WithCaller() Option
WithCaller adds a field with the caller (Go file name and line)
func WithHostname ¶
WithHostname sets a host name as log field
func WithLogConsole ¶
WithLogConsole enables human readable logging to console
func WithLogLevel ¶
WithLogLevel sets a specific loglevel given as string (e.g. debug)
func WithNanoSeconds ¶
func WithNanoSeconds() Option
WithNanoSeconds logs timestamp with nanos if millis are not enough
func WithServiceName ¶
WithServiceName sets a service name as log field
Click to show internal directories.
Click to hide internal directories.