Created
April 9, 2020 09:40
-
-
Save vadzappa/8500d21b4b78c6e0e8d5805511af8753 to your computer and use it in GitHub Desktop.
Sample logger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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