lambdalog

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

lambdalog

The AWS logging helper tools

Documentation

Index

Constants

View Source
const (
	ServiceNameKey     string = "service.name"
	AWSRequestID       string = "aws.request_id"
	AWSFunctionName    string = "aws.function_name"
	AWSFunctionVersion string = "aws.function_version"
	AWSLogGroupName    string = "aws.log_group_name"
	AWSLogStreamName   string = "aws.log_stream_name"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	SugaredLogger *zap.SugaredLogger
	ZapLogger     *zap.Logger
}

func New

func New(name string, ctx *lambdacontext.LambdaContext) (*Logger, error)

New returns new `lambdalog.Logger` that sends log events to a zap.Logger.

func (*Logger) Debug

func (l *Logger) Debug(i ...interface{})

Debug uses fmt.Sprint to construct and log a message.

func (*Logger) Error

func (l *Logger) Error(i ...interface{})

Error uses fmt.Sprint to construct and log a message.

func (*Logger) Info

func (l *Logger) Info(i ...interface{})

Info uses fmt.Sprint to construct and log a message.

func (*Logger) Log

func (l *Logger) Log(i ...interface{}) error

Info uses fmt.Sprint to construct and log a message, as an alternative to Info.

func (*Logger) Sync

func (l *Logger) Sync() error

Sync flushes any buffered log entries.

func (*Logger) Warn

func (l *Logger) Warn(i ...interface{})

Warn uses fmt.Sprint to construct and log a message.

Jump to

Keyboard shortcuts

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