brannigan

package module
v0.0.0-...-b8323c4 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

README

GoDoc

Brannigan

Zap + capnslog (Captain's log) = Zapp Brannigan

A shim to redirect CoreOS capnslog output to Uber Zap. This is specially useful when embedding etcd into your own application.

go get github.com/charithe/brannigan

Usage

brannigan.RedirectCapnslogToGlobalZapLogger()
// or use your own logger instance
brannigan.RedirectCapnslog(yourZapLogger)

Documentation

Overview

Package brannigan contains helper methods to redirect CoreOS capnslog output to an Uber Zap logger

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewZapFormatter

func NewZapFormatter(logger *zap.Logger) capnslog.Formatter

NewZapFormatter creates a capnslog Formatter that delegates to the provided zap logger

func RedirectCapnslog

func RedirectCapnslog(logger *zap.Logger)

RedirectCapnslog sets the capnslog formatter to the provided zap logger

func RedirectCapnslogToGlobalZapLogger

func RedirectCapnslogToGlobalZapLogger()

RedirectCapnslogToGlobalZapLogger sets the capnslog formatter to the global zap logger

Types

type ZapFormatter

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

ZapFormatter implements the capnslog.Formatter interface

func (*ZapFormatter) Flush

func (z *ZapFormatter) Flush()

func (*ZapFormatter) Format

func (z *ZapFormatter) Format(pkg string, level capnslog.LogLevel, depth int, entries ...interface{})

Jump to

Keyboard shortcuts

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