Skip to content
forked from bombsimon/logrusr

📝 A logr implementation using Logrus

License

Notifications You must be signed in to change notification settings

maxan98/logrusr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logrusr

Coverage Status Go Report Card golangci-lint

A logr implementation using logrus.

Usage

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

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

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

For more details, see example.

Implementation details

The NewLogger 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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%