From: Holger Schemel Date: Wed, 8 Feb 2023 12:47:15 +0000 (+0100) Subject: renamed program log file to use program basename X-Git-Tag: 4.3.5.0~8 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=71cea4c5471c3924c9b40e314d38fc209a48a499;p=rocksndiamonds.git renamed program log file to use program basename --- diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 9885217c..a76bba56 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -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); diff --git a/src/libgame/misc.h b/src/libgame/misc.h index 13b513d8..c8e00c84 100644 --- a/src/libgame/misc.h +++ b/src/libgame/misc.h @@ -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); diff --git a/src/libgame/system.c b/src/libgame/system.c index 26c2c043..5a63172f 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -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; diff --git a/src/libgame/system.h b/src/libgame/system.h index ce5f4a67..082fc252 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -706,8 +706,6 @@ #define FALLBACK_TEXT_FILENAME "fallback.txt" -#define LOG_FILENAME "stdout.txt" - #define STRING_PARENT_DIRECTORY ".." #define STRING_TOP_DIRECTORY "/"