Skip to content

Commit

Permalink
Merge pull request #6 from mattn/loglevel
Browse files Browse the repository at this point in the history
Don't set "warning" as code to be possible to specify with -v
  • Loading branch information
ngaut committed Jul 10, 2014
2 parents 3add67d + 562235a commit 40545a8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gearmand.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ package main

import (
"flag"
"fmt"
gearmand "github.com/ngaut/gearmand/server"
"github.com/ngaut/gearmand/storage/mysql"
"github.com/ngaut/gearmand/storage/redisq"
"github.com/ngaut/gearmand/storage/sqlite3"
log "github.com/ngaut/logging"
"runtime"
"strconv"
)

var (
Expand All @@ -21,10 +23,13 @@ var (
)

func main() {
flag.Lookup("v").DefValue = fmt.Sprint(log.LOG_LEVEL_WARN)
flag.Parse()
gearmand.PublishCmdline()
gearmand.RegisterCoreDump(*path)
log.SetLevelByString("warning")
if lv, err := strconv.Atoi(flag.Lookup("v").Value.String()); err == nil {
log.SetLevel(log.LogLevel(lv))
}
//log.SetHighlighting(false)
runtime.GOMAXPROCS(1)
if *storage == "redis" {
Expand Down

0 comments on commit 40545a8

Please sign in to comment.