* Option `-B' to always show the output of builders, regardless of

verbosity level.
This commit is contained in:
Eelco Dolstra 2004-01-13 16:35:43 +00:00
parent 3495d153b3
commit ff9af107d3
7 changed files with 27 additions and 1 deletions

View file

@ -9,6 +9,8 @@
<command>nix-env</command> <command>nix-env</command>
<arg rep='repeat'><option>--verbose</option></arg> <arg rep='repeat'><option>--verbose</option></arg>
<arg rep='repeat'><option>-v</option></arg> <arg rep='repeat'><option>-v</option></arg>
<arg><option>--build-output</option></arg>
<arg><option>-B</option></arg>
<arg><option>--keep-failed</option></arg> <arg><option>--keep-failed</option></arg>
<arg><option>-K</option></arg> <arg><option>-K</option></arg>
<arg> <arg>

View file

@ -9,6 +9,8 @@
<command>nix-store</command> <command>nix-store</command>
<arg rep='repeat'><option>--verbose</option></arg> <arg rep='repeat'><option>--verbose</option></arg>
<arg rep='repeat'><option>-v</option></arg> <arg rep='repeat'><option>-v</option></arg>
<arg><option>--build-output</option></arg>
<arg><option>-B</option></arg>
<arg><option>--keep-failed</option></arg> <arg><option>--keep-failed</option></arg>
<arg><option>-K</option></arg> <arg><option>-K</option></arg>
<arg choice='plain'><replaceable>operation</replaceable></arg> <arg choice='plain'><replaceable>operation</replaceable></arg>

View file

@ -71,3 +71,17 @@
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><option>--build-output</option> / <option>-B</option></term>
<listitem>
<para>
Causes the output written by build actions to standard output
and standard error to be echoed to standard error, regardless of
verbosity level. By default, it is only echoed at a verbosity
level of at least 4 (<quote>Debug</quote>), and is suppressed at
lower levels. Note that it is always written to a log file in
<filename><replaceable>prefix</replaceable>/nix/var/log/nix</filename>.
</para>
</listitem>
</varlistentry>

View file

@ -51,6 +51,8 @@ static void initAndRun(int argc, char * * argv)
string arg = *i; string arg = *i;
if (arg == "--verbose" || arg == "-v") if (arg == "--verbose" || arg == "-v")
verbosity = (Verbosity) ((int) verbosity + 1); verbosity = (Verbosity) ((int) verbosity + 1);
else if (arg == "--build-output" || arg == "-B")
buildVerbosity = lvlError; /* lowest */
else if (arg == "--help") { else if (arg == "--help") {
printHelp(); printHelp();
return; return;

View file

@ -22,7 +22,7 @@ void runProgram(const string & program,
{ {
/* Create a log file. */ /* Create a log file. */
string logCommand = string logCommand =
verbosity >= lvlDebug verbosity >= buildVerbosity
? "tee " + logFileName + " >&2" ? "tee " + logFileName + " >&2"
: "cat > " + logFileName; : "cat > " + logFileName;
/* !!! auto-pclose on exit */ /* !!! auto-pclose on exit */

View file

@ -7,3 +7,5 @@ string nixStateDir = "/UNINIT";
string nixDBPath = "/UNINIT"; string nixDBPath = "/UNINIT";
bool keepFailed = false; bool keepFailed = false;
Verbosity buildVerbosity = lvlDebug;

View file

@ -2,6 +2,7 @@
#define __GLOBALS_H #define __GLOBALS_H
#include <string> #include <string>
#include "util.hh"
using namespace std; using namespace std;
@ -28,5 +29,8 @@ extern string nixDBPath;
/* Whether to keep temporary directories of failed builds. */ /* Whether to keep temporary directories of failed builds. */
extern bool keepFailed; extern bool keepFailed;
/* Verbosity level for build output. */
extern Verbosity buildVerbosity;
#endif /* !__GLOBALS_H */ #endif /* !__GLOBALS_H */