summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-03-06 16:43:12 +0900
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-03-06 16:45:26 +0900
commitedeb8292e79e4db15377aef61f167191fcca0b59 (patch)
treed5b2bef1d91bfd6a47f35090dcb369ea1d3930ba
parent87790c1149ff93576ba06aa879cd7ad953587964 (diff)
gobgpd: stop coloring when stdout log is disabled
close #740 Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r--gobgpd/main.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/gobgpd/main.go b/gobgpd/main.go
index 89f3126a..04c2b262 100644
--- a/gobgpd/main.go
+++ b/gobgpd/main.go
@@ -148,7 +148,13 @@ func main() {
}
}
- if opts.LogPlain == false {
+ if opts.LogPlain {
+ if opts.DisableStdlog {
+ log.SetFormatter(&log.TextFormatter{
+ DisableColors: true,
+ })
+ }
+ } else {
log.SetFormatter(&log.JSONFormatter{})
}