Browse Source

Only add log.Lmicroseconds if log.Ltime is set

Also, move it out of Serve so it's possible to override.
Carl Jackson 12 years ago
parent
commit
2ab51bb360
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      goji.go

+ 3
- 2
goji.go View File

@ -46,6 +46,9 @@ import (
func init() { func init() {
bind.WithFlag() bind.WithFlag()
if fl := log.Flags(); fl&log.Ltime != 0 {
log.SetFlags(fl | log.Lmicroseconds)
}
} }
// Serve starts Goji using reasonable defaults. // Serve starts Goji using reasonable defaults.
@ -54,8 +57,6 @@ func Serve() {
flag.Parse() flag.Parse()
} }
log.SetFlags(log.Flags() | log.Lmicroseconds)
// Install our handler at the root of the standard net/http default mux. // Install our handler at the root of the standard net/http default mux.
// This allows packages like expvar to continue working as expected. // This allows packages like expvar to continue working as expected.
http.Handle("/", DefaultMux) http.Handle("/", DefaultMux)


Loading…
Cancel
Save