summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/driver.cc5
-rw-r--r--kernel/log.cc5
-rw-r--r--kernel/log.h1
3 files changed, 8 insertions, 3 deletions
diff --git a/kernel/driver.cc b/kernel/driver.cc
index 8164fef2..7f466839 100644
--- a/kernel/driver.cc
+++ b/kernel/driver.cc
@@ -141,6 +141,8 @@ int main(int argc, char **argv)
}
break;
case 'q':
+ if (log_errfile == stderr)
+ log_quiet_warnings = true;
log_errfile = stderr;
break;
case 'v':
@@ -170,7 +172,8 @@ int main(int argc, char **argv)
fprintf(stderr, " suppress printing of footer (log hash, version, timing statistics)\n");
fprintf(stderr, "\n");
fprintf(stderr, " -q\n");
- fprintf(stderr, " quiet operation. only write error messages to console\n");
+ fprintf(stderr, " quiet operation. only write warnings and error messages to console\n");
+ fprintf(stderr, " use this option twice to also quiet warning messages\n");
fprintf(stderr, "\n");
fprintf(stderr, " -v <level>\n");
fprintf(stderr, " print log headers up to level <level> to the console. (implies -q)\n");
diff --git a/kernel/log.cc b/kernel/log.cc
index 9f9c4db9..0773429a 100644
--- a/kernel/log.cc
+++ b/kernel/log.cc
@@ -41,6 +41,7 @@ SHA1 *log_hasher = NULL;
bool log_time = false;
bool log_cmd_error_throw = false;
+bool log_quiet_warnings = false;
int log_verbose_level;
std::vector<int> header_count;
@@ -154,14 +155,14 @@ void logv_header(const char *format, va_list ap)
void logv_warning(const char *format, va_list ap)
{
- if (log_errfile != NULL)
+ if (log_errfile != NULL && !log_quiet_warnings)
log_files.push_back(log_errfile);
log("Warning: ");
logv(format, ap);
log_flush();
- if (log_errfile != NULL)
+ if (log_errfile != NULL && !log_quiet_warnings)
log_files.pop_back();
}
diff --git a/kernel/log.h b/kernel/log.h
index b69e2ee2..278e35b4 100644
--- a/kernel/log.h
+++ b/kernel/log.h
@@ -47,6 +47,7 @@ extern SHA1 *log_hasher;
extern bool log_time;
extern bool log_cmd_error_throw;
+extern bool log_quiet_warnings;
extern int log_verbose_level;
void logv(const char *format, va_list ap);