logs

package
v0.0.0-...-dea83b8 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	*zap.Logger
}

Logger wraps the implementation of the logger to provide a more flexible interface.

func FromContext

func FromContext(ctx context.Context) *Logger

func New

func New() (*Logger, error)

New constructs a new instance of a Logger.

func (Logger) AddToContext

func (l Logger) AddToContext(ctx context.Context) context.Context

func (*Logger) Log

func (l *Logger) Log(msg string, keyvals ...interface{})

Log allows zap logger to meet the Fulton TwitchLogging interface: code.justin.tv/amzn/TwitchLogging Log does a best effort logging of the given args using zap as an underlying logger The fulton logger expects a main message, then a series of keys and values as followup arguments for structured logging, like

fultonlogger.Log("my main message!", "KEY1", "VALUE1", "KEY2", "VALUE2")

Here, we will usher this into something that zap likes by taking those keypairs and shoving them into zap.String() calls

Implementation heavily adapted from JSON fulton logger: https://git-aws.internal.justin.tv/amzn/TwitchLoggingCommonLoggers/blob/mainline/json_logger.go#L35-L54

func (*Logger) NewStdLogger

func (l *Logger) NewStdLogger() *golog.Logger

func (*Logger) With

func (l *Logger) With(fields ...zapcore.Field) *Logger

Jump to

Keyboard shortcuts

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