Bug fixing

This commit is contained in:
2023-03-17 15:25:35 +00:00
parent 35a00c96ee
commit 6d69566857
21 changed files with 227 additions and 116 deletions

View File

@@ -16,9 +16,10 @@ char *catstr[] = {"engine", "script"};
FILE *logfile = NULL;
#define CONSOLE_BUF 1024*1024/* 1MB */
#define CONSOLE_BUF 1024*1024*5/* 5MB */
char lastlog[ERROR_BUFFER] = {'\0'};
char consolelog[CONSOLE_BUF] = {'\0'};
void mYughLog(int category, int priority, int line, const char *file, const char *message, ...)
{
@@ -39,6 +40,8 @@ void mYughLog(int category, int priority, int line, const char *file, const char
fprintf(stderr, "%s", buffer);
fflush(stderr);
strncat(consolelog, buffer, CONSOLE_BUF);
if (logfile) {
fprintf(logfile, "%s", buffer);
fflush(logfile);