zapgcp

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 2 Imported by: 0

README

This package was developed by Silicon Ally while working on a project for Adventure Scientists. Many thanks to Adventure Scientists for supporting our open source mission!

zapgcp

zapgcp is a simple package for configuring a zap (go.uber.org/zap) logger for use with Google Cloud Platform's Cloud Logging infrastructure. Check out the examples/ directory and the docs for more details and usage instructions.

GoDoc CI Workflow

Documentation

Overview

Package zapgcp is a simple package for configuring a zap (go.uber.org/zap) logger for use with Google Cloud Platform's Cloud Logging infrastructure. The production config is based on this example: https://github.com/uber-go/zap/issues/1095#issuecomment-1149455643

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg *Config) (*zap.Logger, error)

New returns a zap Logger configured for the environment specified in `cfg`.

Types

type Config

type Config struct {
	// Local determines whether to use a local development config, which is tuned
	// for readability in a console, or the production config, which is meant to be
	// consumed by GCP Cloud Logging.
	Local bool

	// MinLogLevel sets the lowest level to actually output logs for.
	MinLogLevel zapcore.Level

	Options []zap.Option
}

func (*Config) ToZapConfig

func (cfg *Config) ToZapConfig() (zap.Config, []zap.Option)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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