Help us shape the future of Go! Take the 2026 Go Developer Survey

logrusltsv

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2017 License: MIT Imports: 6 Imported by: 0

README

logrus-ltsv

LTSV Formatter for Logrus(github.com/sirupsen/logrus)

Usage

package main

import (
	log "github.com/sirupsen/logrus"
	"github.com/doloopwhile/logrusltsv"
)

func main() {
	log.SetFormatter(&logrusltsv.Formatter{})

	log.WithFields(log.Fields{
		"animal": "walrus",
		"size":   10,
	}).Info("A walrus appears")

	// => time:2015-03-23T12:24:35+09:00\tlevel:info\tmsg:A walrus appears\tanimal:walrus\tsize:10
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

type Formatter struct {
	// contains filtered or unexported fields
}

func New

func New() *Formatter

func (*Formatter) AddFilter

func (f *Formatter) AddFilter(key string, fn func(interface{}) interface{})

func (*Formatter) AddIgnore

func (f *Formatter) AddIgnore(key string)

func (*Formatter) Format

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

Jump to

Keyboard shortcuts

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