logrusctx

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(logLevel logger.Level, opts ...bundles.Option) (xcontext.Context, context.CancelFunc)

NewContext is a simple-to-use function to create a context.Context with canceling explicitly using logrus as the logger.

Note: the upstream "logrus" is in maintenance-mode. A quote from the README.md:

> Logrus is in maintenance-mode. We will not be introducing new features. > It's simply too hard to do in a way that won't break many people's > projects, which is the last thing you want from your Logging library (again...). > > This does not mean Logrus is dead. Logrus will continue to be maintained > for security, (backwards compatible) bug fixes, and performance (where we > are limited by the interface). > > I believe Logrus' biggest contribution is to have played a part in today's > widespread use of structured logging in Golang. There doesn't seem to be > a reason to do a major, breaking iteration into Logrus V2, since the > fantastic Go community has built those independently. Many fantastic > alternatives have sprung up. Logrus would look like those, had it been > re-designed with what we know about structured logging in Go today. > Check out, for example, Zerolog, Zap, and Apex.

Types

type CompactTextFormatter

type CompactTextFormatter struct {
	TimestampFormat string
}

func (*CompactTextFormatter) Format

func (f *CompactTextFormatter) Format(entry *logrus.Entry) ([]byte, error)

Jump to

Keyboard shortcuts

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