Skip to content

Latest commit

 

History

History
105 lines (67 loc) · 2.42 KB

readme-template.md

File metadata and controls

105 lines (67 loc) · 2.42 KB

{{ .title.name }}

{{ .title.description }}

GoDoc Build Status Coverage Status Go Report

Installation

{{ .installation }}

Quick Start

{{ .quickStart.code}}

{{ .quickStart.description }}

Usage

There are some non context fields such as FunctionName which you can add to all logging requests

lambdazapper := New(lambdazap.ProcessNonContextFields(false)).With(lambdazap.FunctionName, lambdazap.FunctionVersion, lambdazap.AwsRequestID)
logger.With(lambdazapper.NonContextValues()...))
logger.Info("only non context values")

The above will log FunctionName and FunctionVersion but not RequestId.

The Non Context fields are

FunctionName
FunctionVersion
LogGroupName
LogStreamName
MemoryLimitInMB

Note by default all context and non context will be logged. The option lambdazap.ProcessNonContextFields(false) will NOT log non context values (e.g. FunctionName) when used like this

logger.Info("only context values. No FunctionName!", lambdazapper.ContextValues()...)

Examples

{{- range .examples }}

{{.}}

{{- end }}

Prerequisites

go 1.x

Tests

{{- range .tests }}

{{.}}

{{- end }}

Benchmarks

In the spirit of Uber's zap logger, zero allocations are used:

Type Time Objects Allocated
Non Context ~150 ns/op 0 allocs/op
With Basic ~400 ns/op 0 allocs/op
With All ~733 ns/op 0 allocs/op

Deployment

Contributing

All PRs are welcome

Authors

License

This project is licensed under the Apache License - see the LICENSE file for details

Acknowledgments

TODO