mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
Properly format multiline logs
As a side effect, colouring on Windows should now work regardless of version
This commit is contained in:
parent
2c171a9b02
commit
32f725d32f
8 changed files with 217 additions and 66 deletions
|
@ -178,3 +178,20 @@ TEST(logging, last_precedence)
|
|||
cleanup();
|
||||
}
|
||||
|
||||
TEST(logging, multiline)
|
||||
{
|
||||
init();
|
||||
mlog_set_categories("global:INFO");
|
||||
MGINFO("first\nsecond\nthird");
|
||||
std::string str;
|
||||
ASSERT_TRUE(load_log_to_string(log_filename, str));
|
||||
ASSERT_TRUE(nlines(str) == 3);
|
||||
ASSERT_TRUE(str.find("global") != std::string::npos);
|
||||
ASSERT_TRUE(str.find("first") != std::string::npos);
|
||||
ASSERT_TRUE(str.find("second") != std::string::npos);
|
||||
ASSERT_TRUE(str.find("third") != std::string::npos);
|
||||
ASSERT_TRUE(str.find("first\nsecond") == std::string::npos);
|
||||
ASSERT_TRUE(str.find("second\nthird") == std::string::npos);
|
||||
cleanup();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue