本文整理汇总了C++中SuperLogger::enable_message_coloring方法的典型用法代码示例。如果您正苦于以下问题:C++ SuperLogger::enable_message_coloring方法的具体用法?C++ SuperLogger::enable_message_coloring怎么用?C++ SuperLogger::enable_message_coloring使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SuperLogger
的用法示例。
在下文中一共展示了SuperLogger::enable_message_coloring方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parse
void CommandLineHandlerBase::parse(
const int argc,
const char* argv[],
SuperLogger& logger)
{
ParseResults results;
impl->m_parser.parse(argc, argv, results);
if (impl->m_message_coloring.is_set())
logger.enable_message_coloring();
if (impl->m_message_verbosity.is_set())
set_verbosity(logger, impl->m_message_verbosity.value());
if (impl->m_version.is_set())
print_version_information(logger);
if (impl->m_system.is_set())
print_system_information(logger);
if (impl->m_help.is_set())
{
const string program_name = filesystem::path(argv[0]).filename().string();
print_program_usage(program_name.c_str(), logger);
exit(0);
}
if (impl->m_display_options.is_set())
{
LOG_INFO(logger, "recognized options:");
impl->m_parser.print_recognized_options(logger);
}
results.m_messages.print(logger);
if (results.m_errors > 0 || results.m_warnings > 0)
{
LOG(
logger,
results.m_errors > 0 ? LogMessage::Fatal : LogMessage::Warning,
FMT_SIZE_T " error%s, " FMT_SIZE_T " warning%s encountered while parsing the command line.",
results.m_errors,
results.m_errors > 1 ? "s" : "",
results.m_warnings,
results.m_warnings > 1 ? "s" : "");
}
}
示例2: parse
void CommandLineHandlerBase::parse(const int argc, const char* argv[], SuperLogger& logger)
{
impl->m_executable_name = bf::path(argv[0]).filename().string();
impl->m_parser.parse(argc, argv, impl->m_parse_results);
if (impl->m_help.is_set())
{
print_program_usage(impl->m_executable_name.c_str(), logger);
exit(EXIT_SUCCESS);
}
if (impl->m_message_coloring.is_set())
logger.enable_message_coloring();
if (impl->m_message_verbosity.is_set())
logger.set_verbosity_level_from_string(impl->m_message_verbosity.value().c_str());
}
示例3: main
int main(int argc, const char* argv[])
{
start_memory_tracking();
SuperLogger logger;
Application::check_installation(logger);
g_cl.parse(argc, argv, logger);
// Read the application's settings from disk.
load_settings(logger);
if (g_settings.get_optional<bool>("message_coloring", false))
logger.enable_message_coloring();
// Run unit tests.
if (g_cl.m_run_unit_tests.is_set())
run_unit_tests(logger);
// Run unit benchmarks.
if (g_cl.m_run_unit_benchmarks.is_set())
run_unit_benchmarks(logger);
// Dump entity definitions.
if (g_cl.m_dump_entity_definitions.is_set())
dump_entity_definitions(logger);
// Render the specified project.
if (!g_cl.m_filenames.values().empty())
{
const string project_filename = g_cl.m_filenames.values().front();
if (g_cl.m_benchmark_mode.is_set())
benchmark_render(project_filename, logger);
else render(project_filename, logger);
}
return 0;
}