Skip to content

keepeye/logrus-filename

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This package is extracted from onrik/logrus.

USAGE

package main

import (
	"github.com/sirupsen/logrus"
	"github.com/keepeye/logrus-filename"
)

func main() {
	filenameHook := filename.NewHook()
	filenameHook.Field = "line"
	logrus.AddHook(filenameHook)
	logrus.Info("aha")
}

output:

INFO[0000] aha                                       line="box-api-server/test.go:12"

About

Logrus hook for logging filename and line number

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages