added colon to WRITE_FORMAT flag
and implemented it => that flag is used for getting length of log prefix so yeah you get it hehe
This commit is contained in:
parent
914e7a2020
commit
f2a62fdb7b
@ -35,7 +35,7 @@ const enum RETURN_CODES //exit codes you fucking idiot (2#)
|
||||
#define LOG_FORMATTING "%s/%s_%03x.log" //SAME THING AS LOG_FORMAT, BUT USED IN sprintf IN logger.c, NOT AS LENGTH
|
||||
#define LOG_FORMATTING_START "%04d-%02d-%02d" //FIRST PART OF LOG_FORMATTING
|
||||
|
||||
#define WRITE_FORMAT "[hh:mm:ss] " //LOG MESSAGE'S PREFIX (THE SPACE AT THE END IS INTENTIONAL)
|
||||
#define WRITE_FORMAT "[hh:mm:ss]: " //LOG MESSAGE'S PREFIX (THE SPACE AT THE END IS INTENTIONAL)
|
||||
#define WRITE_FORMATTING "[%02d:%02d:%02d]: %s\n" //guess what
|
||||
|
||||
#define LOG_LATEST_FORMATTING "%s/%s"
|
||||
|
@ -139,7 +139,7 @@ void writeLog(int loggerFile, char *logMessage)
|
||||
message = logMessageUsed;
|
||||
}
|
||||
|
||||
buffer = malloc(strlen(WRITE_FORMAT) + strlen(message) + 3); //ALLOCATE
|
||||
buffer = malloc(strlen(WRITE_FORMAT) + strlen(message) + 2); //ALLOCATE
|
||||
|
||||
sprintf(buffer, WRITE_FORMATTING, tm.tm_hour, tm.tm_min, tm.tm_sec, message); //LOAD MESSAGE
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user