Documentation ¶
Overview ¶
Package logger contains tools such as defaults and hooks for working with logrus (github.com/sirupsen/logrus) correctly inside Blacksmith.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CLI = &logrus.Logger{ Out: os.Stdout, Level: logrus.InfoLevel, Hooks: logrus.LevelHooks{}, Formatter: &logrus.TextFormatter{ DisableTimestamp: true, }, ExitFunc: os.Exit, }
CLI is the logger used by the Blacksmith CLI for managing logs in a non-running application.
View Source
var Default = &logrus.Logger{ Out: os.Stdout, Level: logrus.InfoLevel, Hooks: logrus.LevelHooks{}, Formatter: &logrus.TextFormatter{ FullTimestamp: true, }, ExitFunc: os.Exit, }
Default is the default logger used by Blacksmith applications.
Functions ¶
Types ¶
type UsingError ¶
type UsingError struct{}
UsingError respect the logrus Hook interface and allows the Blacksmith logger to format errors (using the helper/errors package) across adapters and in the application.
func (*UsingError) Fire ¶
func (hook *UsingError) Fire(entry *logrus.Entry) error
Fire format the given message to an appropriate error.
func (*UsingError) Levels ¶
func (hook *UsingError) Levels() []logrus.Level
Levels return the level used by the hook. Use for error level only.
Click to show internal directories.
Click to hide internal directories.