change name to external, let python konw about new level
This commit is contained in:
parent
0428686581
commit
9d8889e3f2
@ -35,7 +35,7 @@ LOG_LEVEL_DEBUG = 0
|
|||||||
LOG_LEVEL_INFO = 1
|
LOG_LEVEL_INFO = 1
|
||||||
LOG_LEVEL_WARNING = 2
|
LOG_LEVEL_WARNING = 2
|
||||||
LOG_LEVEL_ERROR = 3
|
LOG_LEVEL_ERROR = 3
|
||||||
LOG_LEVEL_FUZZER = 4
|
LOG_LEVEL_EXTERNAL = 4
|
||||||
LOG_LEVEL_FATAL = 5
|
LOG_LEVEL_FATAL = 5
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ enum DeepState_LogLevel {
|
|||||||
DeepState_LogWarning = 2,
|
DeepState_LogWarning = 2,
|
||||||
DeepState_LogWarn = DeepState_LogWarning,
|
DeepState_LogWarn = DeepState_LogWarning,
|
||||||
DeepState_LogError = 3,
|
DeepState_LogError = 3,
|
||||||
DeepState_LogFuzzer = 4,
|
DeepState_LogExternal = 4,
|
||||||
DeepState_LogFatal = 5,
|
DeepState_LogFatal = 5,
|
||||||
DeepState_LogCritical = DeepState_LogFatal,
|
DeepState_LogCritical = DeepState_LogFatal,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -53,7 +53,7 @@ static const char *DeepState_LogLevelStr(enum DeepState_LogLevel level) {
|
|||||||
return "WARNING";
|
return "WARNING";
|
||||||
case DeepState_LogError:
|
case DeepState_LogError:
|
||||||
return "ERROR";
|
return "ERROR";
|
||||||
case DeepState_LogFuzzer:
|
case DeepState_LogExternal:
|
||||||
return "EXTERNAL";
|
return "EXTERNAL";
|
||||||
case DeepState_LogFatal:
|
case DeepState_LogFatal:
|
||||||
return "FATAL";
|
return "FATAL";
|
||||||
@ -73,7 +73,7 @@ char DeepState_LogBuf[DeepState_LogBufSize + 1] = {};
|
|||||||
/* Log a C string. */
|
/* Log a C string. */
|
||||||
DEEPSTATE_NOINLINE
|
DEEPSTATE_NOINLINE
|
||||||
void DeepState_Log(enum DeepState_LogLevel level, const char *str) {
|
void DeepState_Log(enum DeepState_LogLevel level, const char *str) {
|
||||||
if (DeepState_UsingLibFuzzer && (level < DeepState_LogFuzzer)) {
|
if (DeepState_UsingLibFuzzer && (level < DeepState_LogExternal)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
memset(DeepState_LogBuf, 0, DeepState_LogBufSize);
|
memset(DeepState_LogBuf, 0, DeepState_LogBufSize);
|
||||||
@ -97,7 +97,7 @@ void DeepState_LogVFormat(enum DeepState_LogLevel level,
|
|||||||
const char *format, va_list args) {
|
const char *format, va_list args) {
|
||||||
struct DeepState_VarArgs va;
|
struct DeepState_VarArgs va;
|
||||||
va_copy(va.args, args);
|
va_copy(va.args, args);
|
||||||
if (DeepState_UsingLibFuzzer && (level < DeepState_LogFuzzer)) {
|
if (DeepState_UsingLibFuzzer && (level < DeepState_LogExternal)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DeepState_LogStream(level);
|
DeepState_LogStream(level);
|
||||||
@ -170,7 +170,7 @@ int vfprintf(FILE *file, const char *format, va_list args) {
|
|||||||
} else if (stdout == file) {
|
} else if (stdout == file) {
|
||||||
DeepState_LogVFormat(DeepState_LogInfo, format, args);
|
DeepState_LogVFormat(DeepState_LogInfo, format, args);
|
||||||
} else {
|
} else {
|
||||||
DeepState_LogVFormat(DeepState_LogFuzzer, format, args);
|
DeepState_LogVFormat(DeepState_LogExternal, format, args);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
Old code. Now let's just log everything with odd dest as "external."
|
Old code. Now let's just log everything with odd dest as "external."
|
||||||
@ -178,7 +178,7 @@ int vfprintf(FILE *file, const char *format, va_list args) {
|
|||||||
if (!DeepState_UsingLibFuzzer) {
|
if (!DeepState_UsingLibFuzzer) {
|
||||||
if (strstr(format, "INFO:") != NULL) {
|
if (strstr(format, "INFO:") != NULL) {
|
||||||
// Assume such a string to an nonstd target is libFuzzer
|
// Assume such a string to an nonstd target is libFuzzer
|
||||||
DeepState_LogVFormat(DeepState_LogFuzzer, format, args);
|
DeepState_LogVFormat(DeepState_LogExternal, format, args);
|
||||||
} else {
|
} else {
|
||||||
DeepState_LogStream(DeepState_LogWarning);
|
DeepState_LogStream(DeepState_LogWarning);
|
||||||
DeepState_Log(DeepState_LogWarning,
|
DeepState_Log(DeepState_LogWarning,
|
||||||
@ -186,7 +186,7 @@ int vfprintf(FILE *file, const char *format, va_list args) {
|
|||||||
DeepState_LogVFormat(DeepState_LogInfo, format, args);
|
DeepState_LogVFormat(DeepState_LogInfo, format, args);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DeepState_LogVFormat(DeepState_LogFuzzer, format, args);
|
DeepState_LogVFormat(DeepState_LogExternal, format, args);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user