本文整理汇总了C++中SuperLogger::get_log_target方法的典型用法代码示例。如果您正苦于以下问题:C++ SuperLogger::get_log_target方法的具体用法?C++ SuperLogger::get_log_target怎么用?C++ SuperLogger::get_log_target使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SuperLogger
的用法示例。
在下文中一共展示了SuperLogger::get_log_target方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print_program_usage
void CommandLineHandler::print_program_usage(
const char* program_name,
SuperLogger& logger) const
{
SaveLogFormatterConfig save_config(logger);
logger.set_format(LogMessage::Info, "{message}");
LOG_INFO(logger, "usage: %s [project.appleseed]", program_name);
LOG_INFO(logger, "options:");
parser().print_usage(logger);
#ifdef _WIN32
const StringLogTarget& target =
static_cast<const StringLogTarget&>(logger.get_log_target());
const QString str = QString::fromStdString(target.get_string());
QMessageBox msgbox;
msgbox.setWindowTitle("appleseed.studio Program Usage");
msgbox.setIcon(QMessageBox::Information);
msgbox.setText("<pre>" + str + "</pre>");
msgbox.setStandardButtons(QMessageBox::Ok);
msgbox.setDefaultButton(QMessageBox::Ok);
msgbox.exec();
#endif
}
示例2: main
int main(int argc, const char* argv[])
{
SuperLogger logger;
Application::check_installation(logger);
CommandLineHandler cl;
cl.parse(argc, argv, logger);
global_logger().add_target(&logger.get_log_target());
// Construct the schema filename.
const filesystem::path schema_path =
filesystem::path(Application::get_root_path())
/ "schemas/project.xsd";
// Load the input project from disk.
ProjectFileReader reader;
auto_release_ptr<Project> project(
reader.read(
cl.m_filename.values()[0].c_str(),
schema_path.file_string().c_str()));
// Bail out if the project couldn't be loaded.
if (project.get() == 0)
return 1;
// Write the project back to disk.
return ProjectFileWriter::write(project.ref()) ? 0 : 1;
}
示例3: main
int main(int argc, const char* argv[])
{
SuperLogger logger;
Application::check_installation(logger);
CommandLineHandler cl;
cl.parse(argc, argv, logger);
// Initialize the renderer's logger.
global_logger().add_target(&logger.get_log_target());
// Retrieve the input file path.
const string& input_filepath = cl.m_filename.value();
// Construct the schema file path.
const filesystem::path schema_filepath =
filesystem::path(Application::get_root_path())
/ "schemas"
/ "project.xsd";
// Read the input project from disk.
// Note: it is crucial that we read mesh files as well, so that we can collect
// material slots declared by objects. Material slots are required by the project
// file updater, for instance when migrating projects from rev. 7 to rev. 8.
ProjectFileReader reader;
auto_release_ptr<Project> project(
reader.read(
input_filepath.c_str(),
schema_filepath.string().c_str(),
ProjectFileReader::OmitProjectFileUpdate));
// Bail out if the project couldn't be loaded.
if (project.get() == 0)
return 1;
// Update the project file to the desired revision.
ProjectFileUpdater updater;
if (cl.m_to_revision.is_set())
updater.update(project.ref(), cl.m_to_revision.value());
else updater.update(project.ref());
// Write the project back to disk.
const bool success =
ProjectFileWriter::write(
project.ref(),
project->get_path(),
ProjectFileWriter::OmitWritingGeometryFiles | ProjectFileWriter::OmitBringingAssets);
return success ? 0 : 1;
}
示例4: print_program_usage
void CommandLineHandler::print_program_usage(
const char* program_name,
SuperLogger& logger) const
{
LogTargetBase& log_target = logger.get_log_target();
const LogMessage::FormattingFlags old_flags =
log_target.set_formatting_flags(LogMessage::Info, LogMessage::DisplayMessage);
LOG_INFO(logger, "usage: %s [options] project.appleseed", program_name);
LOG_INFO(logger, "options:");
parser().print_usage(logger);
log_target.set_formatting_flags(LogMessage::Info, old_flags);
}
示例5: main
int main(int argc, const char* argv[])
{
SuperLogger logger;
Application::check_installation(logger);
CommandLineHandler cl;
cl.parse(argc, argv, logger);
global_logger().add_target(&logger.get_log_target());
// Retrieve the input file path.
const string& input_filepath = cl.m_filename.values()[0];
// Construct the schema file path.
const string schema_filepath =
(filesystem::path(Application::get_root_path())
/ "schemas" / "project.xsd").string();
// Load the input project from disk.
ProjectFileReader reader;
auto_release_ptr<Project> project(
reader.read(
input_filepath.c_str(),
schema_filepath.c_str(),
ProjectFileReader::OmitReadingMeshFiles | ProjectFileReader::OmitProjectFileUpdate));
// Bail out if the project couldn't be loaded.
if (project.get() == 0)
return 1;
// Update the project file to the desired revision.
ProjectFileUpdater updater;
if (cl.m_to_revision.is_set())
updater.update(project.ref(), cl.m_to_revision.values()[0]);
else updater.update(project.ref());
// Write the project back to disk.
const bool success =
ProjectFileWriter::write(
project.ref(),
project->get_path(),
ProjectFileWriter::OmitWritingMeshFiles | ProjectFileWriter::OmitCopyingAssets);
return success ? 0 : 1;
}
示例6: main
int main(int argc, const char* argv[])
{
SuperLogger logger;
Application::check_installation(logger);
CommandLineHandler cl;
cl.parse(argc, argv, logger);
// Initialize the renderer's logger.
global_logger().add_target(&logger.get_log_target());
// Retrieve the command line arguments.
const string& input_filepath = cl.m_filenames.values()[0];
const string& output_filepath = cl.m_filenames.values()[1];
const FluffParams params(cl);
// Construct the schema file path.
const filesystem::path schema_filepath =
filesystem::path(Application::get_root_path())
/ "schemas"
/ "project.xsd";
// Read the input project from disk.
ProjectFileReader reader;
auto_release_ptr<Project> project(
reader.read(
input_filepath.c_str(),
schema_filepath.string().c_str()));
// Bail out if the project couldn't be loaded.
if (project.get() == 0)
return 1;
// Fluffify the project.
make_fluffy(project.ref(), params);
// Write the project back to disk.
const bool success =
ProjectFileWriter::write(
project.ref(),
output_filepath.c_str());
return success ? 0 : 1;
}