Documentation

Overview

Package zgcp provides log extensions and hooks for Google Cloud Platform services.

TODO: examples

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrorReportingLogger

func NewErrorReportingLogger(
	l *zap.Logger,
	service ServiceConfig,
	fields Fields,
	debug bool,
	opts ...option.ClientOption,
) (*zap.Logger, error)

NewErrorReportingLogger attaches the GCP Stackdriver Error Reporting client to the given zap logger. See https://cloud.google.com/error-reporting

Types

type Fields

type Fields struct {
	UserKey    string
	RequestKey string
}

Fields defines special fields to parse out of a set of Zap fields. If empty, then will be ignored.

type ServiceConfig

type ServiceConfig struct {
	ProjectID string
	Name      string
	Version   string
}

ServiceConfig defines configuration for a Google Cloud Platform service

Source Files