logging compataibility with emacs

This commit is contained in:
2023-01-31 23:41:09 +00:00
parent 35b9482928
commit fcf6f76949
3 changed files with 6 additions and 9 deletions

View File

@@ -11,8 +11,8 @@
#define logLevel 0
//char *logstr[] = { "INFO", "WARN", "\x1b[1;31mERROR\x1b[0m", "CRITICAL" };
char *logstr[] = { "INFO", "WARN", "ERROR", "CRITICAL" };
char *catstr[] = {"ENGINE", "SCRIPT"};
char *logstr[] = { "info", "warn", "error", "critical" };
char *catstr[] = {"engine", "script"};
FILE *logfile = NULL;
@@ -34,7 +34,7 @@ void mYughLog(int category, int priority, int line, const char *file, const char
va_end(args);
char buffer[ERROR_BUFFER] = { '\0' };
snprintf(buffer, ERROR_BUFFER, "%s | %s | %s [ %s:%d ] %s\n", logstr[priority], catstr[category], dt, file, line, msgbuffer);
snprintf(buffer, ERROR_BUFFER, "%s:%d: %s, %s | %s\n", file, line, logstr[priority], catstr[category], msgbuffer);
fprintf(stderr, "%s", buffer);
fflush(stderr);