stackdriver

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2018 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package stackdriver implements a Stackdriver LogEntry support for zap package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStackdriverConfig

func NewStackdriverConfig() zap.Config

NewStackdriverConfig ...

func NewStackdriverEncoder

func NewStackdriverEncoder(ctx context.Context, projectID, logID string) zapcore.Encoder

func NewStackdriverEncoderConfig

func NewStackdriverEncoderConfig() zapcore.EncoderConfig

Types

type Encoder

type Encoder struct {
	zapcore.Encoder
	// contains filtered or unexported fields
}

func (*Encoder) Clone

func (e *Encoder) Clone() zapcore.Encoder

func (*Encoder) EncodeEntry

func (e *Encoder) EncodeEntry(ent zapcore.Entry, fields []zapcore.Field) (*buffer.Buffer, error)

type HTTPRequest

type HTTPRequest struct {
	Method    string
	URL       string
	UserAgent string
	Referrer  string
	Status    int
	RemoteIP  string
	Latency   time.Duration
}

LINK: https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#HttpRequest

func (HTTPRequest) MarshalLogObject

func (req HTTPRequest) MarshalLogObject(enc zapcore.ObjectEncoder) error

MarshalLogObject implements zapcore ObjectMarshaler.

type ServiceContext

type ServiceContext struct {
	Service string `json:"service"`
	Version string `json:"version"`
}

func (ServiceContext) MarshalLogObject

func (sc ServiceContext) MarshalLogObject(enc zapcore.ObjectEncoder) error

MarshalLogObject implements zapcore ObjectMarshaler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳