logrus

package module
v0.0.0-...-123c969 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2018 License: MIT Imports: 3 Imported by: 0

README

Logrus

A logrus implementation of log.Logger. For more on the interface and other implementations, see the log README.

package main

import (
	logr "github.com/go-log/logrus"
	"github.com/sirupsen/logrus"
)

func main {
	l := logr.WithFields(logrus.Fields{
		"foo": "bar",
	})

	l.Log("a log line")
}

You can also use print.New to convert logrus loggers to log.Logger. For an example, see here.

Documentation

Overview

Package logrus allows the creation of Loggers based on logrus.StandardLogger().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() log.Logger

WithFields creates a new logger based on logrus.StandardLogger().

func WithFields

func WithFields(f logrus.Fields) log.Logger

WithFields creates a new logger based on logrus.WithFields().

Types

This section is empty.

Jump to

Keyboard shortcuts

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