diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-03-06 16:43:12 +0900 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-03-06 16:45:26 +0900 |
commit | edeb8292e79e4db15377aef61f167191fcca0b59 (patch) | |
tree | d5b2bef1d91bfd6a47f35090dcb369ea1d3930ba /gobgpd/main.go | |
parent | 87790c1149ff93576ba06aa879cd7ad953587964 (diff) |
gobgpd: stop coloring when stdout log is disabled
close #740
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'gobgpd/main.go')
-rw-r--r-- | gobgpd/main.go | 8 |
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{}) } |