)
// LogFunc is a helper type to reduce typing.
-type LogFunc func(level safcm.LogLevel, format string, a ...interface{})
+type LogFunc func(level safcm.LogLevel, msg string)
type Logger struct {
- fun LogFunc
- prefix string
+ fun LogFunc
}
-func NewLogger(prefix string, fun LogFunc) *Logger {
+func NewLogger(fun LogFunc) *Logger {
return &Logger{
- fun: fun,
- prefix: prefix,
+ fun: fun,
}
}
func (l *Logger) log(level safcm.LogLevel,
format string, a ...interface{}) {
- l.fun(level, "%s %s", l.prefix, fmt.Sprintf(format, a...))
+ l.fun(level, fmt.Sprintf(format, a...))
}