rollzap

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: MIT Imports: 4 Imported by: 1

README

Test Go Report

Rollbar Zap

A simple zapcore.Core implementation to integrate with Rollbar. (forked and modified from https://github.com/bearcherian/rollzap)

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

Testing

To test this code use RC_TOKEN=MY_ROLLBAR_TOKEN go test

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RollbarCore

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

RollbarCore is a custom core to send logs to Rollbar. Add the core using zapcore.NewTee

func NewRollbarCore

func NewRollbarCore(minLevel zapcore.Level) *RollbarCore

NewRollbarCore creates a new core to transmit logs to rollbar. rollbar token and other options should be set before creating a new core

func (*RollbarCore) Check

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

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

func (*RollbarCore) Sync

func (c *RollbarCore) Sync() error

Sync flushes

func (*RollbarCore) With

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

With provides structure

func (*RollbarCore) Write

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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