rollzap

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2018 License: MIT Imports: 4 Imported by: 5 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Rollbar Zap

A simple zapcore.Core implementation to integrate with Rollbar.

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 {
	// 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) Enabled

func (le *RollbarCore) Enabled(l zapcore.Level) bool

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
⌂ 换网址