Skip to content

Instantly share code, notes, and snippets.

@jfeng45
Created July 3, 2019 12:41
Show Gist options
  • Save jfeng45/e4ff69ce161fec0a78cd89cd5ac82d71 to your computer and use it in GitHub Desktop.
Save jfeng45/e4ff69ce161fec0a78cd89cd5ac82d71 to your computer and use it in GitHub Desktop.
generic logger interface
// Log is a package level variable, every program should access logging function through "Log"
var Log Logger
// Logger represent common interface for logging function
type Logger interface {
Errorf(format string, args ...interface{})
Fatalf(format string, args ...interface{})
Fatal(args ...interface{})
Infof(format string, args ...interface{})
Info( args ...interface{})
Warnf(format string, args ...interface{})
Debugf(format string, args ...interface{})
Debug(args ...interface{})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment