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 ¶
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.
Types ¶
This section is empty.