Skip to content

Instantly share code, notes, and snippets.

@vadzappa
Created April 9, 2020 09:40
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 vadzappa/8500d21b4b78c6e0e8d5805511af8753 to your computer and use it in GitHub Desktop.
Save vadzappa/8500d21b4b78c6e0e8d5805511af8753 to your computer and use it in GitHub Desktop.
Sample logger
package logger
import (
"log"
)
func Log(level, message string, args ...interface{}) {
params := append([]interface{}{level + ": ", message + " "}, args...)
log.Print(params...)
}
func Info(message string, args ...interface{}) {
Log("info", message, args...)
}
func Error(message string, args ...interface{}) {
Log("error", message, args...)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment