-
Notifications
You must be signed in to change notification settings - Fork 272
Open
Description
I have a simple logger setup:
import logging "github.com/op/go-logging"
func main() {
...
log := logging.MustGetLogger(name)
// Setup the logger
logBackend := logging.NewLogBackend(os.Stdout, "", 0)
var format = logging.MustStringFormatter(
`%{time:2006-01-02 15:04:05.000} : %{level:-6.6s} : %{message}`,
)
logging.timeNow = timeNow
logBackendFormatter := logging.NewBackendFormatter(logBackend, format)
logging.SetBackend(logBackendFormatter)
}
and I am trying to get it to output timestamps in UTC time, but I do not see a way to do this. I think setting logging.timeNow
would work, but this isn't possible because it is not exported. Is there a way to do this? If not, could we support using custom time functions? I'd like to use something like:
func UtcTimeNow() time.Time {
return time.Now().UTC()
}
Thanks!
Metadata
Metadata
Assignees
Labels
No labels