Don't log in init. You should avoid I/O during initialization in any case.
As the docs make clear, glog is just an export of a Google-internal
package. It's there because many people have asked for "leveled"
logging and the package shows one efficient way to provide it; the
public packages I've seen provide no way to avoid evaluating the
arguments to the logging call. Plus it's got a couple of nice
features, like -vmodule. And it's thoroughly tested, thread-safe, and
robust, and does things like file rollover at midnight. It's
But the package is designed for Google, and in particular to match in
minute detail the external behavior (files, flags, etc.) of an extant
C++ logging package. It's unlikely to be a perfect fit for just about
anyone else, although it's quite usable.
The package is what it is, and it will evolve only as the internal
Google package evolves.
If you want something different, it's open source and you are free to
take the source or its ideas and provide an alternative. As I've said
before, I hope someone will.
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 firstname.lastname@example.org.
For more options, visit https://groups.google.com/groups/opt_out.