control log level
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user