Skip to content

Instantly share code, notes, and snippets.

@evanphx
Created October 20, 2015 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evanphx/dd794c6b06b34839bcf2 to your computer and use it in GitHub Desktop.
Save evanphx/dd794c6b06b34839bcf2 to your computer and use it in GitHub Desktop.
package log
import "github.com/Sirupsen/logrus"
func InfoK(str string, args ...interface{}) {
f := logrus.Fields{}
for i := 0; i < len(args); i += 2 {
f[args[i].(string)] = args[i+1]
}
logrus.WithFields(f).Infoln(str)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment