mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-04 13:42:55 +01:00
Merge pull request #1281 from mzmiric5/develop
closes #1204, add log_info
This commit is contained in:
@@ -23,14 +23,15 @@
|
||||
#include <stdio.h>
|
||||
#include "diagnostic.h"
|
||||
|
||||
int _log_levels[DIAGNOSTIC_LEVEL_COUNT] = { 1, 1, 1, 0 };
|
||||
int _log_levels[DIAGNOSTIC_LEVEL_COUNT] = { 1, 1, 1, 0, 1 };
|
||||
int _log_location_enabled = 1;
|
||||
|
||||
const char * _level_strings[] = {
|
||||
"FATAL",
|
||||
"ERROR",
|
||||
"WARNING",
|
||||
"VERBOSE"
|
||||
"VERBOSE",
|
||||
"INFO"
|
||||
};
|
||||
|
||||
void diagnostic_log(int diagnosticLevel, const char *format, ...)
|
||||
|
||||
@@ -26,6 +26,7 @@ enum {
|
||||
DIAGNOSTIC_LEVEL_ERROR,
|
||||
DIAGNOSTIC_LEVEL_WARNING,
|
||||
DIAGNOSTIC_LEVEL_VERBOSE,
|
||||
DIAGNOSTIC_LEVEL_INFORMATION,
|
||||
DIAGNOSTIC_LEVEL_COUNT
|
||||
};
|
||||
|
||||
@@ -42,6 +43,7 @@ void diagnostic_log_with_location(int diagnosticLevel, const char *file, const c
|
||||
#define log_error(format, ...) diagnostic_log_macro(DIAGNOSTIC_LEVEL_ERROR, format, __VA_ARGS__)
|
||||
#define log_warning(format, ...) diagnostic_log_macro(DIAGNOSTIC_LEVEL_WARNING, format, __VA_ARGS__)
|
||||
#define log_verbose(format, ...) diagnostic_log(DIAGNOSTIC_LEVEL_VERBOSE, format, __VA_ARGS__)
|
||||
#define log_info(format, ...) diagnostic_log_macro(DIAGNOSTIC_LEVEL_INFORMATION, format, __VA_ARGS__)
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@@ -350,6 +350,21 @@ static int object_list_cache_load(int totalFiles, uint64 totalFileSize, int file
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if (pluginHeader.total_files != totalFiles) {
|
||||
int fileCount = totalFiles - pluginHeader.total_files;
|
||||
if (fileCount < 0) {
|
||||
log_info("%d object removed... updating object list cache", abs(fileCount));
|
||||
} else {
|
||||
log_info("%d object added... updating object list cache", fileCount);
|
||||
}
|
||||
} else if (pluginHeader.total_file_size != totalFileSize) {
|
||||
log_info("Objects files size changed... updating object list cache");
|
||||
} else if (pluginHeader.date_modified_checksum != fileDateModifiedChecksum) {
|
||||
log_info("Objects files have been updated... updating object list cache");
|
||||
}
|
||||
|
||||
fclose(file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
fclose(file);
|
||||
|
||||
Reference in New Issue
Block a user