renamed program log file to use program basename
authorHolger Schemel <info@artsoft.org>
Wed, 8 Feb 2023 12:47:15 +0000 (13:47 +0100)
committerHolger Schemel <info@artsoft.org>
Wed, 8 Feb 2023 12:47:15 +0000 (13:47 +0100)
src/libgame/misc.c
src/libgame/misc.h
src/libgame/system.c
src/libgame/system.h

index 9885217c4706ae77366cff4ddc47f50d646ae9a4..a76bba5653a55990f0504cffedd738ed262ef320 100644 (file)
@@ -4179,6 +4179,11 @@ void FreeCustomArtworkLists(struct ArtworkListInfo *artwork_info)
 // (now also added for Windows, to create files in user data directory)
 // ----------------------------------------------------------------------------
 
+char *getLogBasename(char *basename)
+{
+  return getStringCat2(basename, ".log");
+}
+
 char *getLogFilename(char *basename)
 {
   return getPath2(getMainUserGameDataDir(), basename);
index 13b513d8e23f6f8faf5f4a52d3bb4d8b4f96231b..c8e00c843cce5a59ff03f46edbecb659f8c70d19 100644 (file)
@@ -294,6 +294,7 @@ void LoadArtworkConfig(struct ArtworkListInfo *);
 void ReloadCustomArtworkList(struct ArtworkListInfo *);
 void FreeCustomArtworkLists(struct ArtworkListInfo *);
 
+char *getLogBasename(char *);
 char *getLogFilename(char *);
 void OpenLogFile(void);
 void CloseLogFile(void);
index 26c2c043c32b6ce5344b620c3f0196c6c590ab2e..5a63172f72421e6c0fe58095bce1864945d636cb 100644 (file)
@@ -99,7 +99,7 @@ void InitProgramInfo(char *command_filename,
 
   program.version_string = program_version_string;
 
-  program.log_filename = getLogFilename(LOG_FILENAME);
+  program.log_filename = getLogFilename(getLogBasename(program_basename));
   program.log_file = program.log_file_default = stdout;
 
   program.api_thread_count = 0;
index ce5f4a673aa751c1a17c3dad972a2e5e12743b32..082fc252cee7b33286944fa5d36b126c629fc9f8 100644 (file)
 
 #define FALLBACK_TEXT_FILENAME "fallback.txt"
 
-#define LOG_FILENAME           "stdout.txt"
-
 #define STRING_PARENT_DIRECTORY                ".."
 #define STRING_TOP_DIRECTORY           "/"