From 10f58b432ebc53331154e573eaf2d121c28ba0e6 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Wed, 19 Jun 2024 05:50:40 -0400 Subject: [PATCH] truncate log files on init --- code/grime/logger.odin | 1 + 1 file changed, 1 insertion(+) diff --git a/code/grime/logger.odin b/code/grime/logger.odin index e05d76a..04ebba0 100644 --- a/code/grime/logger.odin +++ b/code/grime/logger.odin @@ -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