From 1e182679cfe465f656be02cb2a32ccd9645ce1c7 Mon Sep 17 00:00:00 2001 From: Frederic Lemoine Date: Mon, 30 Jan 2017 16:51:44 +0100 Subject: [PATCH] Print logs to stderr --- cmd/support.go | 6 +++--- support/mast.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/support.go b/cmd/support.go index eeb9c52..3691fd2 100644 --- a/cmd/support.go +++ b/cmd/support.go @@ -36,10 +36,10 @@ The supports implemented are : if err != nil { io.ExitWithMessage(err) } - if supportLogFile != "stdout" { + if supportLogFile != "stderr" { supportLog, err = os.Create(supportLogFile) } else { - supportLog = os.Stdout + supportLog = os.Stderr } if err != nil { io.ExitWithMessage(err) @@ -57,5 +57,5 @@ func init() { supportCmd.PersistentFlags().StringVarP(&supportIntree, "reftree", "i", "stdin", "Reference tree input file") supportCmd.PersistentFlags().StringVarP(&supportBoottrees, "bootstrap", "b", "none", "Bootstrap trees input file") supportCmd.PersistentFlags().StringVarP(&supportOutFile, "out", "o", "stdout", "Output tree file, with supports") - supportCmd.PersistentFlags().StringVarP(&supportLogFile, "log-file", "l", "stdout", "Output log file") + supportCmd.PersistentFlags().StringVarP(&supportLogFile, "log-file", "l", "stderr", "Output log file") } diff --git a/support/mast.go b/support/mast.go index bb2afbc..8655231 100644 --- a/support/mast.go +++ b/support/mast.go @@ -214,7 +214,7 @@ func (supporter *MastSupporter) ComputeValue(refTree *tree.Tree, empiricalTrees // bootstrap trees > 0.8 nb_branches_close := 0 for treeV := range bootTreeChannel { - fmt.Println(fmt.Sprintf("CPU : %d - Bootstrap tree %d", cpu, treeV.Id)) + fmt.Fprintf(os.Stderr, "CPU : %d - Bootstrap tree %d\n", cpu, treeV.Id) bootEdges := treeV.Tree.Edges() for i, _ := range edges {