Skip to content
/ logfn Public

simple helper with logging function enter/exit

License

Notifications You must be signed in to change notification settings

chilts/logfn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logfn : simple helper with logging function enter/exit

Overview GoDoc Build Status Code Climate Go Report Card Sourcegraph

Simple helper which allows you to easily log function enter/exit lines.

Install

go get github.com/chilts/logfn

Example

package main

import "github.com/chilts/logfn"

func main() {
	defer logfn.Exit(logfn.Enter("main"))
	myFunc()
}

func myFunc() {
	defer logfn.Exit(logfn.Enter("myFunc"))
}

Will output lines like:

2017/02/20 23:24:44 -> main
2017/02/20 23:24:44 -> myFunc
2017/02/20 23:24:45 <- myFunc
2017/02/20 23:24:45 <- main

Author

By Andrew Chilton, @twitter.

For AppsAttic, @AppsAttic.

License

MIT.

(Ends)

About

simple helper with logging function enter/exit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages