Do not take special handling on log with debug option.

This commit is contained in:
Chen Yufei
2013-07-28 01:03:35 +08:00
parent 9e28987aac
commit 1ebb4d39da

8
log.go
View File

@@ -1,6 +1,6 @@
package main
// This trick is learnt from a post by Rob Pike
// This logging trick is learnt from a post by Rob Pike
// https://groups.google.com/d/msg/golang-nuts/gU7oQGoCkmg/j3nNxuS2O_sJ
import (
@@ -49,11 +49,7 @@ func init() {
func initLog() {
logFile = os.Stdout
if bool(debug) && !isWindows {
// On windows, we don't know if the terminal supports ANSI color, so
// does not turn color by default in debug mode
colorize = true
} else if config.LogFile != "" {
if config.LogFile != "" {
if f, err := os.OpenFile(expandTilde(config.LogFile),
os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0600); err != nil {
fmt.Printf("Can't open log file, logging to stdout: %v\n", err)