Skip to content

Commit 1869470

Browse files
committed
log: append instead of create new file in logger
fixes:#523
1 parent cd8794b commit 1869470

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/utils/utils_log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ void util_log_init(void) {
241241

242242
memcpy(file, arg, len);
243243
file[len] = '\0';
244-
loggerConfig.output = fopen(file, "w");
244+
loggerConfig.output = fopen(file, "w+");
245245
if (!loggerConfig.output) {
246246
loggerConfig.output = stderr;
247247
LOG_ERR("Cannot open output file %s - logging disabled", file);

test/utils/utils_log.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ int fopen_count = 0;
1414
FILE *mock_fopen(const char *filename, const char *mode) {
1515
fopen_count++;
1616
EXPECT_STREQ(filename, expected_filename.c_str());
17-
EXPECT_STREQ(mode, "w");
17+
EXPECT_STREQ(mode, "w+");
1818
return MOCK_FILE_PTR;
1919
}
2020

0 commit comments

Comments
 (0)