Documentation
¶
Index ¶
- type Event
- func (e *Event) Bool(key string, value bool) *Event
- func (e *Event) Bytes(key string, value []byte) *Event
- func (e *Event) Caller() *Event
- func (e *Event) Err(err error) *Event
- func (e *Event) Float32(key string, f float32) *Event
- func (e *Event) Float64(key string, f float64) *Event
- func (e *Event) Int(key string, value int) *Event
- func (e *Event) Int16(key string, value int16) *Event
- func (e *Event) Int32(key string, value int32) *Event
- func (e *Event) Int64(key string, value int64) *Event
- func (e *Event) Int8(key string, value int8) *Event
- func (e *Event) Line() *Event
- func (e *Event) Msg(msg string)
- func (e *Event) Msgf(fmtstr string, vals ...interface{})
- func (e *Event) Str(key string, value string) *Event
- func (e *Event) Time(key string, value time.Time) *Event
- func (e *Event) Uint16(key string, value uint16) *Event
- func (e *Event) Uint32(key string, value uint32) *Event
- func (e *Event) Uint64(key string, value uint64) *Event
- func (e *Event) Uint8(key string, value uint8) *Event
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event represents the text collected for output to a given log Writer
func (*Event) Bytes ¶
Bytes adds a key (variable name) and slice of bytes to the logging event in hex.
func (*Event) Caller ¶
Caller writes the line number and file of the source code that the current function was called from, as the @c_line and @c_file keys.
func (*Event) Line ¶
Line writes the current line number and file of the source code as the @line and @file keys.
func (*Event) Msg ¶
Msg writes the accumulated log entry to the log, along with the message provided.
func (*Event) Msgf ¶
Msgf writes a message formatted as per fmt.Sprintf. It's likely to be slower than any other log event method.
type Logger ¶
type Logger struct { ErrorWriter io.Writer InfoWriter io.Writer DebugWriter io.Writer Timestamp string UTC bool ErrorTag []byte WarnTag []byte InfoTag []byte DebugTag []byte KeyStart []byte KeyEnd []byte Closer func() }
func NewCloudLogger ¶ added in v1.0.3
func NewCloudLogger() *Logger
NewCloudLogger creates a new logger with output to stdout and stderr, no ANSI codes or timestamps.
func NewConsoleLogger ¶
func NewConsoleLogger() *Logger
NewConsoleLogger creates a new logger with output to stdout and stderr, ANSI colored logging level tags, and timestamps to 1 second precision.
func NewFileLogger ¶
NewFileLogger creates a new logger with output to the error and info log filenames provided, no ANSI codes, and timestamps to 1 second precision.
func NewLogger ¶ added in v1.0.3
func NewLogger() *Logger
NewLogger attempts to determine whether stdout is connected to the console. If so, it returns a ConsoleLogger; if not, it returns a PipeLogger.
func NewPipeLogger ¶ added in v1.0.3
func NewPipeLogger() *Logger
NewPipeLogger creates a new logger with output to stdout and stderr, no ANSI codes, and timestamps to 1 second precision.
func (*Logger) Error ¶
Error returns an error level logging event you can add values and messages to