control log level

This commit is contained in:
Alex Groce
2018-12-04 19:43:46 -07:00
parent eb0d4a4569
commit e92f39fb5c
3 changed files with 6 additions and 1 deletions
+2
View File
@@ -64,6 +64,8 @@ DECLARE_bool(take_over);
DECLARE_bool(abort_on_fail);
DECLARE_bool(verbose_reads);
DECLARE_int(log_level);
enum {
DeepState_InputSize = 8192
};
+2
View File
@@ -38,6 +38,8 @@ DEFINE_bool(take_over, false, "Replay test cases in take-over mode.");
DEFINE_bool(abort_on_fail, false, "Abort on file replay failure (useful in file fuzzing).");
DEFINE_bool(verbose_reads, false, "Report on bytes being read during execution of test.");
DEFINE_int(log_level, 0, "Minimum level of logging to output.")
/* Pointer to the last registers DeepState_TestInfo data structure */
struct DeepState_TestInfo *DeepState_LastTestInfo = NULL;
+2 -1
View File
@@ -73,7 +73,8 @@ char DeepState_LogBuf[DeepState_LogBufSize + 1] = {};
/* Log a C string. */
DEEPSTATE_NOINLINE
void DeepState_Log(enum DeepState_LogLevel level, const char *str) {
if (DeepState_UsingLibFuzzer && (level < DeepState_LogExternal)) {
if ((DeepState_UsingLibFuzzer && (level < DeepState_LogExternal)) ||
(level < FLAGS_log_level)) {
return;
}
memset(DeepState_LogBuf, 0, DeepState_LogBufSize);