Skip to content

Commit

Permalink
Setup all logger before calling initLog().
Browse files Browse the repository at this point in the history
  • Loading branch information
cyfdecyf committed Jun 2, 2015
1 parent f1fd6af commit df909fe
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions log.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ package main
import (
"flag"
"fmt"
"github.com/cyfdecyf/color"
"io"
"log"
"os"

"github.com/cyfdecyf/color"
)

type infoLogging bool
Expand All @@ -28,10 +29,10 @@ var (
logFile io.Writer

// make sure logger can be called before initLog
errorLog = log.New(os.Stdout, "", log.LstdFlags)
debugLog = errorLog
requestLog = errorLog
responseLog = errorLog
errorLog = log.New(os.Stdout, "[ERROR] ", log.LstdFlags)
debugLog = log.New(os.Stdout, "[DEBUG] ", log.LstdFlags)
requestLog = log.New(os.Stdout, "[>>>>>] ", log.LstdFlags)
responseLog = log.New(os.Stdout, "[<<<<<] ", log.LstdFlags)

verbose bool
colorize bool
Expand Down

0 comments on commit df909fe

Please sign in to comment.