Skip to content

Commit 2cfbb45

Browse files
committed
Add initial expected_message to the logger test
Add initial expected_message to the logger test. Ref: #552 Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 5d8fd5f commit 2cfbb45

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/utils/utils_log.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ void util_log_init(void) {
251251
}
252252
} else {
253253
loggerConfig.output = stderr;
254-
LOG_ERR("Logging output not set - logging disabled");
254+
LOG_ERR("Logging output not set - logging disabled (UMF_LOG = \"%s\")",
255+
envVar);
255256
loggerConfig.output = NULL;
256257
return;
257258
}

test/utils/utils_log.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ FILE *mock_fopen(const char *filename, const char *mode) {
1919
}
2020

2121
const std::string MOCK_FN_NAME = "MOCK_FUNCTION_NAME";
22-
std::string expected_message = "";
23-
// The "Logging output not set - logging disabled" message is printed to stderr.
22+
std::string expected_message = "[ERROR UMF] util_log_init: Logging output not "
23+
"set - logging disabled (UMF_LOG = \"\")\n";
24+
// The expected_message (above) is printed to stderr.
2425
FILE *expected_stream = stderr;
2526
int expect_fput_count = 0;
2627
int fput_count = 0;

0 commit comments

Comments
 (0)