Skip to content

Commit 1569a95

Browse files
committed
Enable logger in proxy lib
fixes: #605 Signed-off-by: Łukasz Plewa <[email protected]>
1 parent dca2157 commit 1569a95

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/proxy_lib/proxy_lib.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ static __TLS int was_called_from_umfPool = 0;
107107
/*****************************************************************************/
108108

109109
void proxy_lib_create_common(void) {
110+
util_log_init();
110111
umf_os_memory_provider_params_t os_params =
111112
umfOsMemoryProviderParamsDefault();
112113
umf_result_t umf_result;

src/utils/utils_log.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,10 @@ void util_log_init(void) {
254254

255255
memcpy(file, arg, len);
256256
file[len] = '\0';
257-
loggerConfig.output = fopen(file, "w+");
257+
loggerConfig.output = fopen(file, "a");
258258
if (!loggerConfig.output) {
259259
loggerConfig.output = stderr;
260-
LOG_ERR("Cannot open output file %s - logging disabled", file);
260+
LOG_PERR("Cannot open output file %s - logging disabled", file);
261261
loggerConfig.output = NULL;
262262
return;
263263
}

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, "a");
1818
return MOCK_FILE_PTR;
1919
}
2020

0 commit comments

Comments
 (0)