Skip to content

bombsimon/logrusr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

74 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Logrusr

Go Reference GitHub Actions Coverage Status Go Report Card

A logr implementation using logrus.

Usage

import (
    "github.com/bombsimon/logrusr/v4"
    "github.com/go-logr/logr"
    "github.com/sirupsen/logrus"
)

func main() {
    logrusLog := logrus.New()
    log := logrusr.New(logrusLog)

    log = log.WithName("MyName").WithValues("user", "you")
    log.Info("Logr in action!", "the answer", 42)
}

For more details, see example.

Implementation details

The New method takes a logrus.FieldLogger interface as input which means this works with both logrus.Logger and logrus.Entry. This is currently a quite naive implementation in early state. Use with caution.

About

๐Ÿ“ A logr implementation using Logrus

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages