]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
Don't write LOG_BABBLE output to stdout
authorJon TURNEY <jon.turney@dronecode.org.uk>
Mon, 2 Mar 2015 12:10:28 +0000 (12:10 +0000)
committerJon TURNEY <jon.turney@dronecode.org.uk>
Tue, 3 Mar 2015 12:51:58 +0000 (12:51 +0000)
It somewhat hampers the use of setup as a command line tool that it writes
everything to stdout.  Don't write LOG_BABBLE output to stdout.  Add '--verbose'
flag to restore the previous behaviour.

ChangeLog:

2015-03-02  Jon TURNEY  <jon.turney@dronecode.org.uk>

* LogFile.cc (VerboseOutput): Add option.
(endEntry): Only write LOG_PLAIN to stdout, unless VerboseOutput.

ChangeLog
LogFile.cc

index 54e2768ce706b232c8ab14ae94fd81163bbd3436..455984cca5ad00e8559f8e71ac3d2f7e33897a8e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-02  Jon TURNEY  <jon.turney@dronecode.org.uk>
+
+       * LogFile.cc (VerboseOutput): Add option.
+       (endEntry): Only write LOG_PLAIN to stdout, unless VerboseOutput.
+
 2015-03-02  Jon TURNEY  <jon.turney@dronecode.org.uk>
 
        * res.rc (IDD_FILE_INUSE): Add 'Retry' button. Make larger.
index dfb96226a2fde62ce86ae470c5eccb6d954cc163..b45d38ce047ccd3553fe319231d666cbe34220a3 100644 (file)
@@ -36,6 +36,10 @@ static const char *cvsid =
 #include "AntiVirus.h"
 #include "filemanip.h"
 #include "String++.h"
+#include "getopt++/BoolOption.h"
+
+static BoolOption VerboseOutput (false, 'v', "verbose",
+                                 "Verbose output");
 
 using namespace std;
 
@@ -219,7 +223,9 @@ LogFile::endEntry()
   string buf = theStream->str();
   delete theStream;
 
-  cout << buf << endl;
+  /* also write to stdout */
+  if ((currEnt->level >= LOG_PLAIN) || VerboseOutput)
+    cout << buf << endl;
 
   if (!currEnt)
     {
This page took 0.040011 seconds and 5 git commands to generate.