Skip to content

Enable logger in proxy lib #606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/proxy_lib/proxy_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ static __TLS int was_called_from_umfPool = 0;
/*****************************************************************************/

void proxy_lib_create_common(void) {
util_log_init();
umf_os_memory_provider_params_t os_params =
umfOsMemoryProviderParamsDefault();
umf_result_t umf_result;
Expand Down
4 changes: 2 additions & 2 deletions src/utils/utils_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ void util_log_init(void) {

memcpy(file, arg, len);
file[len] = '\0';
loggerConfig.output = fopen(file, "w+");
loggerConfig.output = fopen(file, "a");
if (!loggerConfig.output) {
loggerConfig.output = stderr;
LOG_ERR("Cannot open output file %s - logging disabled", file);
LOG_PERR("Cannot open output file %s - logging disabled", file);
loggerConfig.output = NULL;
return;
}
Expand Down
2 changes: 1 addition & 1 deletion test/utils/utils_log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ int fopen_count = 0;
FILE *mock_fopen(const char *filename, const char *mode) {
fopen_count++;
EXPECT_STREQ(filename, expected_filename.c_str());
EXPECT_STREQ(mode, "w+");
EXPECT_STREQ(mode, "a");
return MOCK_FILE_PTR;
}

Expand Down
Loading