76 CHKERR PetscPrintf(PETSC_COMM_WORLD,
77 "\nTesting logging for obsolete way of printing "
78 "messages\nnext line\nnext line\n\n");
80 CHKERR PetscPrintf(PETSC_COMM_WORLD,
82 CHKERR PetscPrintf(PETSC_COMM_WORLD,
"a ");
83 CHKERR PetscPrintf(PETSC_COMM_WORLD,
86 CHKERR PetscPrintf(PETSC_COMM_WORLD,
"WARNING\n");
91 MOFEM_LOG(
"WORLD", Sev::error) <<
"Hello, self error!";
92 MOFEM_LOG(
"WORLD", Sev::warning) <<
"Hello, self warning!";
93 MOFEM_LOG(
"WORLD", Sev::inform) <<
"Hello, self inform!";
94 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Hello, self verbose!";
95 MOFEM_LOG(
"WORLD", Sev::noisy) <<
"Hello, self noisy!";
99 MOFEM_LOG_C(
"WORLD", Sev::inform,
"%s %d %d %d",
"Hello C, self error!",
110 auto core_log = logging::core::get();
112 LogManager::createSink(LogManager::getStrmSelf(),
"ATOM_TEST"));
113 LogManager::setLog(
"ATOM_TEST");
116 core_log->add_sink(LogManager::createSink(
117 boost::make_shared<std::ofstream>(
"log0.log"),
"ATOM_TEST"));
120 logging::add_file_log(keywords::file_name =
"log1.log",
122 MoFEM::LogKeywords::channel ==
"ATOM_TEST");
125 auto backend = boost::make_shared<sinks::text_ostream_backend>();
126 backend->add_stream(boost::make_shared<std::ofstream>(
"log2.log"));
127 auto sink = boost::make_shared<LogManager::SinkType>(backend);
128 sink->set_filter((expr::has_attr(MoFEM::LogKeywords::channel) &&
129 MoFEM::LogKeywords::channel ==
"ATOM_TEST"));
130 core_log->add_sink(sink);
134 MOFEM_LOG(
"ATOM_TEST", Sev::inform) <<
"Test atom test channel";