IRSOL
C++ code implementing socket server for interacting with Baumer camera.
LoggingListener Class Reference
Inheritance diagram for LoggingListener:

Public Member Functions

void testRunStarting (IRSOL_MAYBE_UNUSED Catch::TestRunInfo const &testRunInfo) override
 
void testRunEnded (IRSOL_MAYBE_UNUSED Catch::TestRunStats const &testRunStats) override
 
void testCaseStarting (Catch::TestCaseInfo const &testInfo) override
 
void testCaseEnded (IRSOL_MAYBE_UNUSED Catch::TestCaseStats const &testCaseStats) override
 

Detailed Description

Definition at line 10 of file main.cpp.

Member Function Documentation

◆ testCaseEnded()

void LoggingListener::testCaseEnded ( IRSOL_MAYBE_UNUSED Catch::TestCaseStats const &  testCaseStats)
inlineoverride

Definition at line 43 of file main.cpp.

44 {
45 IRSOL_LOG_INFO("Testcase ended.");
46 }
#define IRSOL_LOG_INFO(...)
Logs an info-level message using the default logger.
Definition logging.hpp:92

◆ testCaseStarting()

void LoggingListener::testCaseStarting ( Catch::TestCaseInfo const &  testInfo)
inlineoverride

Definition at line 27 of file main.cpp.

28 {
29 std::string testCaseDescription = "";
30 for(const auto& tag : testInfo.tags) {
31 testCaseDescription += tag.original + "][";
32 }
33 if(!testCaseDescription.empty()) {
34 testCaseDescription.pop_back(); // remove trailing '['
35 testCaseDescription += "[" + testInfo.name;
36 } else {
37 testCaseDescription = testInfo.name;
38 }
39
40 irsol::setLoggerName(testCaseDescription.c_str());
41 IRSOL_LOG_INFO("Starting testcase: {}-{}.", testInfo.tagsAsString(), testInfo.name);
42 }
void setLoggerName(const char *name)
Sets the name of the default logger.
Definition logging.cpp:77

◆ testRunEnded()

void LoggingListener::testRunEnded ( IRSOL_MAYBE_UNUSED Catch::TestRunStats const &  testRunStats)
inlineoverride

Definition at line 21 of file main.cpp.

22 {
23 irsol::setLoggerName("unit-tests");
24 IRSOL_LOG_INFO("Test run ended.");
25 }

◆ testRunStarting()

void LoggingListener::testRunStarting ( IRSOL_MAYBE_UNUSED Catch::TestRunInfo const &  testRunInfo)
inlineoverride

Definition at line 15 of file main.cpp.

16 {
17 irsol::setLoggerName("unit-tests");
19 IRSOL_LOG_INFO("Starting unittests.");
20 }
void setLoggingFormat(LoggingFormat format=LoggingFormat::FILE, std::optional< std::shared_ptr< spdlog::logger > > logger=std::nullopt)
Sets the global logging format.
Definition logging.cpp:84
@ UNIT_TESTS
Format suitable for unit test frameworks.

The documentation for this class was generated from the following file: