logger

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 4 Imported by: 7

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

func New

func New() *logrus.Logger

New returns the appropriate logrus Logger given the environment.

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.

Jump to

Keyboard shortcuts

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