op/go-logging — pull request #39 by jeffwilliams (2014-12-03 18:35:40+00:00)
Title: The default backend was printing the date and time before the message

The default backend was printing the date and time before the message.

This means that the default formatter was printing the date instead of
just the message as documented, and setting a custom format for the
default log would have the time prepended to the message.

For example, this code:

package main

import (
"github.com/op/go-logging"
//"github.com/jeffwilliams/go-logging"
)

func main() {
var format = logging.MustStringFormatter(
"%{color}%{time:15:04:05.000000} %{shortfunc} \u25b6 %{level:.4s} %{id:03x}%{color:reset} %{message}",
)
logging.SetFormatter(format)

var log = logging.MustGetLogger("sandbox")

log.Debug("msg")
log.Info("msg")
log.Warning("msg")
}

Outputs these logs:

2014/12/03 13:34:30 13:34:30.511036 main \u25b6 DEBU 001 msg
2014/12/03 13:34:30 13:34:30.511092 main \u25b6 INFO 002 msg
2014/12/03 13:34:30 13:34:30.511121 main \u25b6 WARN 003 msg