log_resource(void): global_level(uhd::log::off), _exit(false), #ifndef UHD_LOG_FASTPATH_DISABLE _fastpath_queue(10), #endif _log_queue(10) { //allow override from macro definition #ifdef UHD_LOG_MIN_LEVEL this->global_level = _get_log_level(BOOST_STRINGIZE(UHD_LOG_MIN_LEVEL), this->global_level); #endif //allow override from environment variables const char * log_level_env = std::getenv("UHD_LOG_LEVEL"); if (log_level_env != NULL && log_level_env[0] != '\0') { this->global_level = _get_log_level(log_level_env, this->global_level); } /***** Console logging ***********************************************/ #ifndef UHD_LOG_CONSOLE_DISABLE uhd::log::severity_level console_level = uhd::log::trace; #ifdef UHD_LOG_CONSOLE_LEVEL console_level = _get_log_level(BOOST_STRINGIZE(UHD_LOG_CONSOLE_LEVEL), console_level); #endif const char * log_console_level_env = std::getenv("UHD_LOG_CONSOLE_LEVEL"); if (log_console_level_env != NULL && log_console_level_env[0] != '\0') { console_level = _get_log_level(log_console_level_env, console_level); } logger_level[UHD_CONSOLE_LOGGER_KEY] = console_level; _loggers[UHD_CONSOLE_LOGGER_KEY] = &console_log; #endif /***** File logging **************************************************/ uhd::log::severity_level file_level = uhd::log::trace; std::string log_file_target; #if defined(UHD_LOG_FILE_LEVEL) && defined(UHD_LOG_FILE_PATH) file_level = _get_log_level(BOOST_STRINGIZE(UHD_LOG_FILE_LEVEL), file_level); log_file_target = BOOST_STRINGIZE(UHD_LOG_FILE); #endif const char * log_file_level_env = std::getenv("UHD_LOG_FILE_LEVEL"); if (log_file_level_env != NULL && log_file_level_env[0] != '\0'){ file_level = _get_log_level(log_file_level_env, file_level); } const char* log_file_env = std::getenv("UHD_LOG_FILE"); if ((log_file_env != NULL) && (log_file_env[0] != '\0')) { log_file_target = std::string(log_file_env); } if (!log_file_target.empty()){ logger_level[UHD_FILE_LOGGER_KEY] = file_level; auto F = boost::make_shared<file_logger_backend>(log_file_target); _loggers[UHD_FILE_LOGGER_KEY] = [F](const uhd::log::logging_info& log_info){F->log(log_info);}; } // Launch log message consumer _pop_task = std::make_shared<std::thread>(std::thread([this](){this->pop_task();})); _pop_fastpath_task = std::make_shared<std::thread>(std::thread([this](){this->pop_fastpath_task();})); }
n230_eeprom_manager::n230_eeprom_manager(const std::string& addr): _seq_num(0) { _udp_xport = transport::udp_simple::make_connected( addr, BOOST_STRINGIZE(N230_FW_COMMS_FLASH_PROG_PORT)); read_mb_eeprom(); }
int cpp_main(int argc, char*[]) { if (argc > 1) cleanup = false; std::cout << "BOOST_FILESYSTEM_C_STR defined as \"" << BOOST_STRINGIZE(BOOST_FILESYSTEM_C_STR) << "\"\n"; // test narrow characters std::cout << "narrow character tests:\n"; test("narrow_fstream_test"); // So that tests are run with known encoding, use Boost UTF-8 codecvt std::locale global_loc = std::locale(); std::locale loc(global_loc, new fs::detail::utf8_codecvt_facet); fs::path::imbue(loc); // test with some wide characters // \u2780 is circled 1 against white background == e2 9e 80 in UTF-8 // \u2781 is circled 2 against white background == e2 9e 81 in UTF-8 // \u263A is a white smiling face std::cout << "\nwide character tests:\n"; std::wstring ws(L"wide_fstream_test_"); ws += 0x2780; ws += 0x263A; test(ws); return ::boost::report_errors(); }
int main() { std::cout << BOOST_COMPILER << "\n"; std::cout << "Detected Platform: " << BOOST_PLATFORM << std::endl; std::cout << "Boost version " << BOOST_STRINGIZE(BOOST_VERSION) <<std::endl; static const std::size_t pointer_size = sizeof(void*)*CHAR_BIT; std::cout << "Address model " << pointer_size << "-bit" <<std::endl; return 0; }
void output_final_html() { if(html_out_file.size()) { // // start with search and replace ops: // std::string::size_type pos; pos = html_contents.find("%compiler%"); if(pos != std::string::npos) { html_contents.replace(pos, 10, BOOST_COMPILER); } pos = html_contents.find("%library%"); if(pos != std::string::npos) { html_contents.replace(pos, 9, BOOST_STDLIB); } pos = html_contents.find("%os%"); if(pos != std::string::npos) { html_contents.replace(pos, 4, BOOST_PLATFORM); } pos = html_contents.find("%boost%"); if(pos != std::string::npos) { html_contents.replace(pos, 7, get_boost_version()); } pos = html_contents.find("%pcre%"); if(pos != std::string::npos) { #ifdef PCRE_MINOR html_contents.replace(pos, 6, BOOST_STRINGIZE(PCRE_MAJOR.PCRE_MINOR)); #else html_contents.replace(pos, 6, "N/A"); #endif } pos = html_contents.find("%averages%"); if(pos != std::string::npos) { html_contents.replace(pos, 10, get_averages_table()); } // // now right the output to file: // std::ofstream os(html_out_file.c_str()); os << html_contents; } else { std::cout << html_contents; } }
log_resource_type(void){ //file lock pointer must be null _file_lock = NULL; //set the default log level level = uhd::_log::never; //allow override from macro definition #ifdef UHD_LOG_LEVEL _set_log_level(BOOST_STRINGIZE(UHD_LOG_LEVEL)); #endif //allow override from environment variable const char * log_level_env = std::getenv("UHD_LOG_LEVEL"); if (log_level_env != NULL) _set_log_level(log_level_env); }
#elif BOOST_WORKAROUND( BOOST_MSVC, < 1930 ) // MSVC does not implement static initialization for constexpr constructors BOOST_PRAGMA_MESSAGE("Skipping test due to BOOST_MSVC < 1930") int main() {} #elif defined(__clang__) && defined( BOOST_NO_CXX14_CONSTEXPR ) // Clang only implements static initialization for constexpr in C++14 mode BOOST_PRAGMA_MESSAGE("Skipping test due to __clang__ and BOOST_NO_CXX14_CONSTEXPR") int main() {} #elif defined( _LIBCPP_VERSION ) && ( _LIBCPP_VERSION < 6000 ) // in libc++, atomic_flag has a non-constexpr constructor from bool BOOST_PRAGMA_MESSAGE("Skipping test due to _LIBCPP_VERSION " BOOST_STRINGIZE(_LIBCPP_VERSION)) int main() {} #elif defined( BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX ) BOOST_PRAGMA_MESSAGE("Skipping test due to BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX") int main() {} #else #include <boost/smart_ptr/atomic_shared_ptr.hpp> #include <boost/core/lightweight_test.hpp> struct X { };