logger

package
v4.7.0-rc1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2018 License: AGPL-3.0, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugc

func Debugc(ctx context.Context, args ...interface{})

Debugc logs a debugLog level message, including context information that is stored in the first parameter. If two parameters are supplied, the second must be a message string, and will be logged directly. If more than two parameters are supplied, the second parameter must be a format string, and the remaining parameters must be the variables to substitute into the format string, following the convention of the fmt.Sprintf(...) function.

func Debugf

func Debugf(args ...interface{})

Debugf logs a debugLog level message. If one parameter is supplied, it must be a message string, and will be logged directly. If two or more parameters are specified, the first parameter must be a format string, and the remaining parameters must be the variables to substitute into the format string, following the convention of the fmt.Sprintf(...) function.

func Errorc

func Errorc(ctx context.Context, args ...interface{})

Errorc logs an error level message, including context information that is stored in the first parameter. If two parameters are supplied, the second must be a message string, and will be logged directly. If more than two parameters are supplied, the second parameter must be a format string, and the remaining parameters must be the variables to substitute into the format string, following the convention of the fmt.Sprintf(...) function.

func Errorf

func Errorf(args ...interface{})

Errorf logs an error level message. If one parameter is supplied, it must be a message string, and will be logged directly. If two or more parameters are specified, the first parameter must be a format string, and the remaining parameters must be the variables to substitute into the format string, following the convention of the fmt.Sprintf(...) function.

func Infoc

func Infoc(ctx context.Context, args ...interface{})

Infoc logs an infoLog level message, including context information that is stored in the first parameter. If two parameters are supplied, the second must be a message string, and will be logged directly. If more than two parameters are supplied, the second parameter must be a format string, and the remaining parameters must be the variables to substitute into the format string, following the convention of the fmt.Sprintf(...) function.

func Infof

func Infof(args ...interface{})

Infof logs an infoLog level message. If one parameter is supplied, it must be a message string, and will be logged directly. If two or more parameters are specified, the first parameter must be a format string, and the remaining parameters must be the variables to substitute into the format string, following the convention of the fmt.Sprintf(...) function.

func NewJSONFileLogger

func NewJSONFileLogger(lvl l4g.Level, filename string) l4g.Logger

NewJSONFileLogger - Create a new logger with a "file" filter configured to send JSON-formatted log messages at or above lvl to a file with the specified filename.

func WithRequestId

func WithRequestId(ctx context.Context, requestID string) context.Context

WithRequestId adds a request id to the specified context. If the returned Context is subsequently passed to a logging method, the request id will automatically be included in the logged message

func WithUserId

func WithUserId(ctx context.Context, userID string) context.Context

WithUserId adds a user id to the specified context. If the returned Context is subsequently passed to a logging method, the user id will automatically be included in the logged message

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL