zap

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(baseURL, accessToken, datasetName string, options ...Option) (zapcore.Core, error)

New creates a new zapcore.Core configured to talk to the specified Axiom deployment and authenticating with the given access token. An ingest token is sufficient enough. The logs will be ingested into the specified dataset. Additional options can be supplied to configure the core.

func NewCloud

func NewCloud(accessToken, orgID, datasetName string, options ...Option) (zapcore.Core, error)

NewCloud is like New() but configures the core to talk to Axiom Cloud.

func NewWithClient

func NewWithClient(client *axiom.Client, datasetName string, options ...Option) (zapcore.Core, error)

NewWithClient behaves like New() but utilizes an already configured axiom.Client to talk to a deployment.

Types

type Option

type Option func(*WriteSyncer) error

An Option modifies the behaviour of the Axiom WriteSyncer.

func IngestOptions

func IngestOptions(opts axiom.IngestOptions) Option

IngestOptions specifies the ingestion options to use for ingesting the logs.

func LevelEnabler

func LevelEnabler(levelEnabler zapcore.LevelEnabler) Option

LevelEnabler sets the level enabler that the Axiom WriteSyncer will us to determine if logs will be shipped to Axiom.

type WriteSyncer

type WriteSyncer struct {
	// contains filtered or unexported fields
}

WriteSyncer implements a zapcore.WriteSyncer used for shipping logs to Axiom.

func (*WriteSyncer) Sync

func (ws *WriteSyncer) Sync() error

Sync implements zapcore.WriteSyncer.

func (*WriteSyncer) Write

func (ws *WriteSyncer) Write(p []byte) (n int, err error)

Write implements zapcore.WriteSyncer.

Jump to

Keyboard shortcuts

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