Skip to content

Commit

Permalink
remove flag definition in init()
Browse files Browse the repository at this point in the history
It causes unexpected consequences at runtime
  • Loading branch information
lziest committed May 20, 2016
1 parent b895b05 commit e5661b7
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
package log

import (
"flag"
"fmt"
"log"
"os"
Expand Down Expand Up @@ -63,13 +62,6 @@ func SetLogger(logger SyslogWriter) {
syslogWriter = logger
}

func init() {
// Only define loglevel flag once.
if flag.Lookup("loglevel") == nil {
flag.IntVar(&Level, "loglevel", LevelInfo, "Log level (0 = DEBUG, 5 = FATAL)")
}
}

func print(l int, msg string) {
if l >= Level {
if syslogWriter != nil {
Expand Down

0 comments on commit e5661b7

Please sign in to comment.