mirror of
https://github.com/FairRootGroup/FairLogger.git
synced 2025-10-15 09:31:44 +00:00
Adjust regex expressions
This commit is contained in:
@@ -27,47 +27,72 @@ int main()
|
||||
|
||||
Logger::DefineVerbosity(Verbosity::user1, spec1);
|
||||
Logger::SetVerbosity(Verbosity::user1); // spec1 on user1
|
||||
CheckOutput(ToStr(R"(^\[.*:\d{2}:.*]\[.*])", " content\n$"), []() { LOG(fatal) << "content"; });
|
||||
CheckOutput(ToStr(R"(^\[.*:\d{2}:.*\]\[.*\])", " content\n$"), []() { LOG(fatal) << "content"; });
|
||||
|
||||
Logger::DefineVerbosity(Verbosity::user1, spec2);
|
||||
Logger::SetVerbosity(Verbosity::user1); // spec2 on user1
|
||||
CheckOutput(ToStr(R"(^\[.*]\[.*:\d{2}:.*])", " content\n$"), []() { LOG(fatal) << "content"; });
|
||||
CheckOutput(ToStr(R"(^\[.*\]\[.*:\d{2}:.*\])", " content\n$"), []() { LOG(fatal) << "content"; });
|
||||
|
||||
Logger::DefineVerbosity(Verbosity::user2, spec1);
|
||||
Logger::SetVerbosity(Verbosity::user2); // spec1 on user2
|
||||
CheckOutput(ToStr(R"(^\[.*:\d{2}:.*]\[.*])", " content\n$"), []() { LOG(fatal) << "content"; });
|
||||
CheckOutput(ToStr(R"(^\[.*:\d{2}:.*\]\[.*\])", " content\n$"), []() { LOG(fatal) << "content"; });
|
||||
|
||||
Logger::SetVerbosity(Verbosity::verylow); // content
|
||||
CheckOutput("^content\n$", []() { LOG(fatal) << "content"; });
|
||||
|
||||
Logger::SetVerbosity(Verbosity::low); // [severity] content
|
||||
CheckOutput(ToStr(R"(^\[FATAL])", " content\n$"), []() { LOG(fatal) << "content"; });
|
||||
CheckOutput(ToStr(R"(^\[FATAL\])", " content\n$"), []() { LOG(fatal) << "content"; });
|
||||
|
||||
Logger::SetVerbosity(Verbosity::medium); // [HH:MM:SS][severity] content
|
||||
CheckOutput(ToStr(R"(^\[\d{2}:\d{2}:\d{2}]\[FATAL])", " content\n$"), []() { LOG(fatal) << "content"; });
|
||||
CheckOutput(ToStr(R"(^\[\d{2}:\d{2}:\d{2}\]\[FATAL\])", " content\n$"), []() { LOG(fatal) << "content"; });
|
||||
|
||||
Logger::SetVerbosity(Verbosity::high); // [process_name][HH:MM:SS][severity] content
|
||||
CheckOutput(ToStr(R"(^\[.*]\[\d{2}:\d{2}:\d{2}]\[FATAL])", " content\n$"), []() { LOG(fatal) << "content"; });
|
||||
CheckOutput(ToStr(R"(^\[.*\]\[\d{2}:\d{2}:\d{2}\]\[FATAL\])", " content\n$"), []() { LOG(fatal) << "content"; });
|
||||
|
||||
Logger::SetVerbosity(Verbosity::veryhigh); // [process_name][HH:MM:SS:µS][severity][file:line:function] content
|
||||
CheckOutput(ToStr(R"(^\[.*]\[\d{2}:\d{2}:\d{2}\.\d{6}]\[FATAL]\[.*:\d+:.*])", " content\n$"), []() { LOG(fatal) << "content"; });
|
||||
CheckOutput(ToStr(R"(^\[.*\]\[\d{2}:\d{2}:\d{2}\.\d{6}\]\[FATAL\]\[.*:\d+:.*\])", " content\n$"), []() { LOG(fatal) << "content"; });
|
||||
|
||||
Logger::SetConsoleColor(true);
|
||||
|
||||
Logger::SetVerbosity(Verbosity::verylow); // content
|
||||
CheckOutput("^content\n$", []() { LOG(fatal) << "content"; });
|
||||
CheckOutput(
|
||||
"^"
|
||||
"content\n"
|
||||
"$", []() { LOG(fatal) << "content"; });
|
||||
|
||||
Logger::SetVerbosity(Verbosity::low); // [severity] content
|
||||
CheckOutput("^\\[\033\\[01;31mFATAL\033\\[0m] content\n$", []() { LOG(fatal) << "content"; });
|
||||
CheckOutput(
|
||||
"^"
|
||||
"\\[\033\\[01;31mFATAL\033\\[0m\\]"
|
||||
" content\n"
|
||||
"$", []() { LOG(fatal) << "content"; });
|
||||
|
||||
Logger::SetVerbosity(Verbosity::medium); // [HH:MM:SS][severity] content
|
||||
CheckOutput("^\\[\033\\[01;36m\\d{2}:\\d{2}:\\d{2}\033\\[0m]\\[\033\\[01;31mFATAL\033\\[0m] content\n$", []() { LOG(fatal) << "content"; });
|
||||
CheckOutput(
|
||||
"^"
|
||||
"\\[\033\\[01;36m\\d{2}:\\d{2}:\\d{2}\033\\[0m\\]"
|
||||
"\\[\033\\[01;31mFATAL\033\\[0m\\]"
|
||||
" content\n"
|
||||
"$", []() { LOG(fatal) << "content"; });
|
||||
|
||||
Logger::SetVerbosity(Verbosity::high); // [process_name][HH:MM:SS][severity] content
|
||||
CheckOutput("^\\[\033\\[01;34m.*\033\\[0m]\\[\033\\[01;36m\\d{2}:\\d{2}:\\d{2}\033\\[0m]\\[\033\\[01;31mFATAL\033\\[0m] content\n$", []() { LOG(fatal) << "content"; });
|
||||
CheckOutput(
|
||||
"^"
|
||||
"\\[\033\\[01;34m.*\033\\[0m\\]"
|
||||
"\\[\033\\[01;36m\\d{2}:\\d{2}:\\d{2}\033\\[0m\\]"
|
||||
"\\[\033\\[01;31mFATAL\033\\[0m\\]"
|
||||
" content\n"
|
||||
"$", []() { LOG(fatal) << "content"; });
|
||||
|
||||
Logger::SetVerbosity(Verbosity::veryhigh); // [process_name][HH:MM:SS:µS][severity][file:line:function] content
|
||||
CheckOutput("^\\[\033\\[01;34m.*\033\\[0m]\\[\033\\[01;36m\\d{2}:\\d{2}:\\d{2}\\.\\d{6}\033\\[0m]\\[\033\\[01;31mFATAL\033\\[0m]\\[\033\\[01;34m.*\033\\[0m:\033\\[01;33m\\d+\033\\[0m:\033\\[01;34m.*\033\\[0m] content\n$", []() { LOG(fatal) << "content"; });
|
||||
CheckOutput(
|
||||
"^"
|
||||
"\\[\033\\[01;34m.*\033\\[0m\\]"
|
||||
"\\[\033\\[01;36m\\d{2}:\\d{2}:\\d{2}\\.\\d{6}\033\\[0m\\]"
|
||||
"\\[\033\\[01;31mFATAL\033\\[0m\\]"
|
||||
"\\[\033\\[01;34m.*\033\\[0m:\033\\[01;33m\\d+\033\\[0m:\033\\[01;34m.*\033\\[0m\\]"
|
||||
" content\n"
|
||||
"$", []() { LOG(fatal) << "content"; });
|
||||
} catch (runtime_error& rte) {
|
||||
cout << rte.what() << endl;
|
||||
return 1;
|
||||
|
Reference in New Issue
Block a user