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_WARNING = 2
|
||||
LOG_LEVEL_ERROR = 3
|
||||
LOG_LEVEL_FUZZER = 4
|
||||
LOG_LEVEL_EXTERNAL = 4
|
||||
LOG_LEVEL_FATAL = 5
|
||||
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ enum DeepState_LogLevel {
|
||||
DeepState_LogWarning = 2,
|
||||
DeepState_LogWarn = DeepState_LogWarning,
|
||||
DeepState_LogError = 3,
|
||||
DeepState_LogFuzzer = 4,
|
||||
DeepState_LogExternal = 4,
|
||||
DeepState_LogFatal = 5,
|
||||
DeepState_LogCritical = DeepState_LogFatal,
|
||||
};
|
||||
|
||||
@ -53,7 +53,7 @@ static const char *DeepState_LogLevelStr(enum DeepState_LogLevel level) {
|
||||
return "WARNING";
|
||||
case DeepState_LogError:
|
||||
return "ERROR";
|
||||
case DeepState_LogFuzzer:
|
||||
case DeepState_LogExternal:
|
||||
return "EXTERNAL";
|
||||
case DeepState_LogFatal:
|
||||
return "FATAL";
|
||||
@ -73,7 +73,7 @@ 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_LogFuzzer)) {
|
||||
if (DeepState_UsingLibFuzzer && (level < DeepState_LogExternal)) {
|
||||
return;
|
||||
}
|
||||
memset(DeepState_LogBuf, 0, DeepState_LogBufSize);
|
||||
@ -97,7 +97,7 @@ void DeepState_LogVFormat(enum DeepState_LogLevel level,
|
||||
const char *format, va_list args) {
|
||||
struct DeepState_VarArgs va;
|
||||
va_copy(va.args, args);
|
||||
if (DeepState_UsingLibFuzzer && (level < DeepState_LogFuzzer)) {
|
||||
if (DeepState_UsingLibFuzzer && (level < DeepState_LogExternal)) {
|
||||
return;
|
||||
}
|
||||
DeepState_LogStream(level);
|
||||
@ -170,7 +170,7 @@ int vfprintf(FILE *file, const char *format, va_list args) {
|
||||
} else if (stdout == file) {
|
||||
DeepState_LogVFormat(DeepState_LogInfo, format, args);
|
||||
} 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."
|
||||
@ -178,7 +178,7 @@ int vfprintf(FILE *file, const char *format, va_list args) {
|
||||
if (!DeepState_UsingLibFuzzer) {
|
||||
if (strstr(format, "INFO:") != NULL) {
|
||||
// Assume such a string to an nonstd target is libFuzzer
|
||||
DeepState_LogVFormat(DeepState_LogFuzzer, format, args);
|
||||
DeepState_LogVFormat(DeepState_LogExternal, format, args);
|
||||
} else {
|
||||
DeepState_LogStream(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);
|
||||
}
|
||||
} else {
|
||||
DeepState_LogVFormat(DeepState_LogFuzzer, format, args);
|
||||
DeepState_LogVFormat(DeepState_LogExternal, format, args);
|
||||
}
|
||||
*/
|
||||
return 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user