generated from Riley/Conan-C
Refactor logging path initialization: use custom appdata path for log files
This commit is contained in:
parent
861c05bc25
commit
ec75e0723e
1 changed files with 4 additions and 2 deletions
|
|
@ -14,8 +14,10 @@
|
|||
|
||||
|
||||
int main(void) {
|
||||
char *log_folder_path = custom_appdata_path("Logs");
|
||||
|
||||
char *log_path = malloc(256);
|
||||
cwk_path_join(appdata_home_path(), "error.log", log_path, 256);
|
||||
cwk_path_join(log_folder_path, "error.log", log_path, 256);
|
||||
FILE *fp_e = fopen(log_path, "a+");
|
||||
if (fp_e) {
|
||||
log_add_fp(fp_e, LOG_ERROR);
|
||||
|
|
@ -25,7 +27,7 @@ int main(void) {
|
|||
free(log_path);
|
||||
|
||||
log_path = malloc(256);
|
||||
cwk_path_join(appdata_home_path(), "debug.log", log_path, 256);
|
||||
cwk_path_join(log_folder_path, "debug.log", log_path, 256);
|
||||
FILE *fp_d = fopen(log_path, "a+");
|
||||
if (fp_d) {
|
||||
log_add_fp(fp_d, LOG_DEBUG);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue