FAQ
Hi,

It seems that there is no way to include the timezone information in
the logging data
printed by the log.Print family of functions.

This poses some mental overhead when comparing log files produced by go binaries
that uses the standard log package from different machines running in different
timezones - the timestamp is in each hosts' timezone but never stated
explicitly.

I don't want to be forced to use a different logging package just to
be able to disambiguate
log timestamp.

Having a log.Ltimezone const alongside log.Ldate and log.Ltime would
help, and maybe log.Lutc to indicate that we want the timestamp to be
in UTC instead of the local timezone.

I think those would be good improvement over the current limitations.

Thanks,

Nazri

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Benjamin Measures at Feb 20, 2015 at 11:24 am

    On Friday, 20 February 2015 07:30:07 UTC, Nazri wrote:
    It seems that there is no way to include the timezone information in
    the logging data
    printed by the log.Print family of functions.
    http://play.golang.org/p/LSe3gcoW9Y
      t, o := time.Now().Zone()
      log.Printf("Timezone: %v %v", t, o)

    If the timezone changes, you can print again.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 20, '15 at 7:30a
activeFeb 20, '15 at 11:24a
posts2
users2
websitegolang.org

2 users in discussion

Benjamin Measures: 1 post Nazri Ramliy: 1 post

People

Translate

site design / logo © 2021 Grokbase