logging

package
v0.0.0-...-ecb7df7 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package logging provides logging infrastructure to Vault.

It is designed so that `Setup` is called once, and from then on, any package may call `logging.Logger()` to retrieve the constructed logger. On the off chance that `Setup` was not called, `Logger` will run it with sensible defaults.

For testing, an observer is set up which provides access to logged messages. This is useful for commands, which often do work such as printing; insight into logs may stand in place of `fmt.Printf` statements.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger() *zap.SugaredLogger

Logger returns a sugared logger. If the logger hasn't been set up, it calls Setup.

func ObserveLogging

func ObserveLogging(level zapcore.Level)

ObserveLogging constructs a logger through the zap/zaptest/observer framework so that logs may be accessible in tests.

func ObserverLogs

func ObserverLogs() *ObservedLogs

ObserverLogs provides the list of logs generated during the observation process.

func Setup

func Setup(environment string, level zapcore.Level) error

Setup builds a sugared logger for use throughout the application.

Types

This section is empty.

Jump to

Keyboard shortcuts

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