truncate log files on init

This commit is contained in:
Edward R. Gonzalez 2024-06-19 05:50:40 -04:00
parent 59ed4d9dd6
commit 10f58b432e

View File

@ -29,6 +29,7 @@ logger_init :: proc( logger : ^ Logger, id : string, file_path : string, file :
logger_file, result_code := file_open( file_path, os.O_RDWR | os.O_CREATE )
assert( result_code == os.ERROR_NONE, "Log failures are fatal and must never occur at runtime (there is no logging)" )
logger.file = logger_file
os.truncate( file_path, 0 )
}
else {
logger.file = file