Categorygithub.com/lthibault/log
modulepackage
1.2.3
Repository: https://github.com/lthibault/log.git
Documentation: pkg.go.dev

# README

log

A high-level API adapter for logrus.

Godoc Reference Go Report Card

Overview

Package log provides a high-level API adapter around logrus. It is intended as a personal utility. You are likely to prefer using Logrus directly.

This package makes the following changes to the logrus API:

  • Functional options for a more user-friendly API.
  • Adds Logger.With method, which applies log fields directly from objects satisfying Loggable.
  • Remove panic-level logging, as Panic and Fatal are semantically equivalent.

Escape hatches are provided to maintain full compatibility with Logrus.

# Packages

Package logtest is a generated GoMock package.
No description provided by the author

# Functions

Debug prints a message at debug level.
Debugf provides fmt.Printf-like formatting for a call to Trace.
Debugln calls Trace, adding a newline to the log output.
Error prints a message at error level.
Errorf provides fmt.Printf-like formatting for a call to Trace.
Errorln calls Trace, adding a newline to the log output.
Fatal prints each value then calls os.Exit(1).
Fatalf provides fmt.Printf-like formatting for a call to Fatal.
Fatalln calls Fatal, appending a newline to the log output.
Info prints a message at info level.
Infof provides fmt.Printf-like formatting for a call to Trace.
Infoln calls Trace, adding a newline to the log output.
New logger.
Trace prints a message at trace level.
Tracef provides fmt.Printf-like formatting for a call to Trace.
Traceln calls Trace, adding a newline to the log output.
Warn prints a message at warn level.
Warnf provides fmt.Printf-like formatting for a call to Trace.
Warnln calls Trace, adding a newline to the log output.
WithFormatter sets the formatter.
WithLevel sets the log level.
WithLevelHooks sets the level hooks.
WithWriter writer.
WrapLogrus is a convenience function.

# Constants

DebugLevel is used to report application state for debugging perposes.
ErrorLevel is used for errors that should definitely be noted.
FatalLevel logs and then calls `os.Exit(1)`.
InfoLevel provides general operational entries about what's going on inside the application.
TraceLevel is used to trace the execution steps of an application for debugging or optimization purposes.
WarnLevel is for non-critical entries that deserve eyes.

# Interfaces

Loggable types provide a loggable representation of their internal state.
Logger provides observability.

# Type aliases

F is a set of fields.
Level indicates the minimum severity threshold for logging.
LevelHooks is a collection of hooks that are synchronously triggered for each logging event.
Option for Logger.