logzzap

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 6 Imported by: 0

README

GoDoc Go Report

Logz Zap

A simple zapcore.Core implementation to integrate with Logz.

To use, initialize logz like normal, create a new LogzCore, then wrap with a NewTee. See the example code for a detailed example.

Testing

To test this code use LZ_TOKEN=MY_LOGZ_TOKEN go test

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogzCore

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

func NewLogzCore

func NewLogzCore(sender logzSender, minLevel zapcore.Level, options ...Option) *LogzCore

NewLogzCore creates a new core to transmit logs to logz. Logz token and other options should be set before creating a new core

func (*LogzCore) Check

func (c *LogzCore) Check(entry zapcore.Entry, checkedEntry *zapcore.CheckedEntry) *zapcore.CheckedEntry

Check determines if this should be sent to roll bar based on LevelEnabler

func (*LogzCore) Sync

func (c *LogzCore) Sync() error

func (*LogzCore) With

func (c *LogzCore) With(fields []zapcore.Field) zapcore.Core

With provides structure

func (*LogzCore) Write

func (c *LogzCore) Write(entry zapcore.Entry, fields []zapcore.Field) error

type Option

type Option func(*LogzCore)

func WithAppName

func WithAppName(name string) Option

func WithEnvironment

func WithEnvironment(env string) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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