 |
Belle II Software
release-05-01-25
|
13 #include <framework/logging/LogSystem.h>
14 #include <gtest/gtest.h>
25 class LogMessageTest:
public ::testing::Test {
30 void SetUp()
override;
void expectMessageVariables(std::map< std::string, std::string > &&variables, bool strict=false)
check if the last message emitted contains the given variables and their values.
void SetUp() override
Add a log message interceptor.
void TearDown() override
And try to reset logging system to default.
ELogLevel
Definition of the supported log levels.
std::vector< LogMessage > m_messages
list of log messages
Some utilities to help with writing unit tests.
@ c_Error
Error: for things that went wrong and have to be fixed.
void expectMessage(LogConfig::ELogLevel level=LogConfig::c_Error, int count=1, bool strict=false)
check if there is a certain number of log messages of a given level
void expectErrorWithVariables(std::map< std::string, std::string > &&variables, bool strict=false)
Expect an error with variables: This is a shorthand to check that there is exactly one error message ...
void clearMessages()
clear the list of save log messages
void expectMessageContent(LogConfig::ELogLevel level, const std::string &message)
check the content of the last log message against the given values