这篇教程C++ BOOST_LOG_SEV函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中BOOST_LOG_SEV函数的典型用法代码示例。如果您正苦于以下问题:C++ BOOST_LOG_SEV函数的具体用法?C++ BOOST_LOG_SEV怎么用?C++ BOOST_LOG_SEV使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了BOOST_LOG_SEV函数的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: calculateGradientFirst Scalar calculateGradientFirst(Geometry1& point, Geometry2& line, Derivative1& dpoint) { if(dist.norm() == 0) return 1.; const Vector3 d_dist = -dpoint.point() + dpoint.point().dot(line.direction())*line.direction(); const Scalar res = dist.dot(d_dist)/dist.norm();#ifdef DCM_USE_LOGGING if(!boost::math::isfinite(res)) BOOST_LOG_SEV(log, details::error) << "Unnormal first cluster gradient detected: "<<res <<" with point: "<<point.point().transpose()<<", line: "<<line.point().transpose() << line.direction().transpose() <<" and dpoint: "<<dpoint.point().transpose();#endif return res; };
开发者ID:ickby,项目名称:openDCM,代码行数:14,
示例2: udsbool generalization_indexer::is_leaf(const object& o) const { // FIXME: massive hack. must not add leafs for services. const auto uds(object_types::user_defined_service); const bool is_service(o.object_type() == uds); if (o.is_parent() || !o.is_child() || is_service) { BOOST_LOG_SEV(lg, debug) << "Type is not in a generalization relationship." << " is parent: " << o.is_parent() << " is child: " << o.is_child() << " is service: " << is_service; return false; } return true;}
开发者ID:Niam99,项目名称:dogen,代码行数:14,
示例3: mainint main(int, char*[]){#if defined(BOOST_LOG_USE_NATIVE_SYSLOG) init_native_syslog();#elif !defined(BOOST_LOG_NO_ASIO) init_builtin_syslog();#endif BOOST_LOG_SCOPED_THREAD_TAG("MyLevel", std::string, "warning"); src::severity_logger< > lg; BOOST_LOG_SEV(lg, 3) << "Hello world!"; return 0;}
开发者ID:yhager,项目名称:boost-log,代码行数:14,
示例4: validatestd::list<field_definition>instantiator::instantiate(const field_definition& fd) const { validate(fd); BOOST_LOG_SEV(lg, debug) << "Instantiating template: " << fd; std::list<field_definition> r; const auto dt(fd.definition_type()); if (dt == field_definition_types::global_template) r = instantiate_global_template(fd); else if (dt == field_definition_types::facet_template) r = instantiate_facet_template(fd); else if (dt == field_definition_types::formatter_template) r = instantiate_formatter_template(fd); else { BOOST_LOG_SEV(lg, error) << unsupported_definition_type << dt; BOOST_THROW_EXCEPTION(instantiation_error(unsupported_definition_type + boost::lexical_cast<std::string>(dt))); } BOOST_LOG_SEV(lg, debug) << "Instantiation result: " << r; return r;}
开发者ID:memsharded,项目名称:dogen,代码行数:23,
示例5: make_configurationhelper_configuration helper_expander::make_configuration(const feature_group& fg, const model& fm) const { BOOST_LOG_SEV(lg, debug) << "Started making the configuration."; helper_configuration r; r.streaming_properties(fm.streaming_properties()); for (auto& pair : fm.formattables()) { const auto id(pair.first); BOOST_LOG_SEV(lg, debug) << "Procesing element: " << id; auto& formattable(pair.second); auto& segment(*formattable.master_segment()); const auto& cfg(*segment.configuration()); const variability::helpers::configuration_selector s(cfg); const auto fam(s.get_text_content_or_default(fg.family)); r.helper_families()[id] = fam; } BOOST_LOG_SEV(lg, debug) << "Finished making the configuration. Result:" << r; return r;}
开发者ID:DomainDrivenConsulting,项目名称:dogen,代码行数:23,
示例6: _library Master::Master(const std::shared_ptr<Library>& library, const MasterParameters& parameters): _library(library), _parameters(parameters), nodeAcceptor(library->ioService(), parseTcpEndpoint(parameters.nodeEndpoint)), clientAcceptor(library->ioService(), parseTcpEndpoint(parameters.clientEndpoint)), heartbeatTimer(library->ioService()), heartbeatRunning(true), _sslContext(ssl::context::tlsv1), disposed(false), nodeAcceptorRunning(true), clientAcceptorRunning(true) { // Setup SSL std::string pw = parameters.sslPassword; sslContext().set_password_callback([pw](std::size_t, ssl::context::password_purpose) { return pw; }); try { BOOST_LOG_SEV(log, LogLevel::Info) << format("Using %s as the certificate chain file.") % parameters.sslCertificateFile; sslContext().use_certificate_chain_file(parameters.sslCertificateFile); } catch (const std::exception& ex) { MSCThrow(InvalidDataException (str(format("Error occured while attempting to use '%s' as the " "certificate chain file: %s") % parameters.sslCertificateFile % ex.what()))); } try { BOOST_LOG_SEV(log, LogLevel::Info) << format("Using %s as the private key file.") % parameters.sslPrivateKeyFile; sslContext().use_private_key_file(parameters.sslPrivateKeyFile, boost::asio::ssl::context::pem); } catch (const std::exception& ex) { MSCThrow(InvalidDataException (str(format("Error occured while attempting to use '%s' as the " "private key file: %s") % parameters.sslPrivateKeyFile % ex.what()))); } BOOST_LOG_SEV(log, LogLevel::Debug) << "SSL is ready."; // Prepare to accept the first client and node BOOST_LOG_SEV(log, LogLevel::Debug) << "Preparing to accept clients and nodes."; waitingNodeConnection = std::make_shared<MasterNodeConnection>(*this); waitingClient = std::make_shared<MasterClient>(*this, 1, _parameters.allowVersionSpecification); acceptNodeConnectionAsync(true); acceptClientAsync(true); // Start heartbeat BOOST_LOG_SEV(log, LogLevel::Debug) << "Starting heartbeat."; doHeartbeat(boost::system::error_code()); BOOST_LOG_SEV(log, LogLevel::Info) << format("Merlion Master Server Core (%s) running.") % MSC_VERSION_STRING; }
开发者ID:yvt,项目名称:Merlion,代码行数:57,
示例7: catchvoid voice_card_control::cti_callout(boost::shared_ptr<cti_call_out_param> cti_call_out_param_){ std::size_t chID; try { chID = m_channel_queue.take(); } catch (std::out_of_range) { BOOST_LOG_SEV(cia_g_logger, RuntimeInfo) << "业务流水:" << cti_call_out_param_->m_transId << " 获取通道失败, 通道全部繁忙"; //继续下一次呼叫 cti_callout_again(cti_call_out_param_); return; } BOOST_LOG_SEV(cia_g_logger, RuntimeInfo) << "业务流水:" << cti_call_out_param_->m_transId << " 获取到得通道状态为:" << SsmChkAutoDial(chID) << ", 通道号码:" << chID; SsmSetTxCallerId(chID, cti_call_out_param_->m_authCode.c_str()); if (SsmAutoDial(chID, cti_call_out_param_->m_pn.c_str()) == 0){ BOOST_LOG_SEV(cia_g_logger, RuntimeInfo) << "业务流水:" << cti_call_out_param_->m_transId << " 已发送请求, 已将此通道对应状态清空, 通道号码:" << chID; boost::shared_ptr<trunk> t = m_trunk_vector.at(chID); boost::unique_lock<boost::mutex> unique_lock_(t->m_trunk_mutex, boost::defer_lock); if (unique_lock_.try_lock()) { t->m_client_socket = cti_call_out_param_->m_base_client; t->m_transId = cti_call_out_param_->m_transId; t->m_caller_id = cti_call_out_param_->m_authCode; t->m_called_id = cti_call_out_param_->m_pn; t->m_hungup_by_echo_tone = cti_call_out_param_->m_hungup_by_echo_tone; t->m_step = TRK_CALLOUT_DAIL; t->m_callTime.restart(); } else { BOOST_LOG_SEV(cia_g_logger, Critical) << "业务流水:" << cti_call_out_param_->m_transId << ", 严重异常, 被分配的语音通道处于占用状态, 请程序猿通宵解决问题"; } } else { m_channel_queue.put(chID); //上一次呼叫失败,继续呼叫 if (cti_call_out_param_->m_repeat_call_out) { cti_call_out_param_->m_repeat_call_out = false; BOOST_LOG_SEV(cia_g_logger, RuntimeInfo) << "业务流水:" << cti_call_out_param_->m_transId << "上一次呼叫失败,继续呼叫"; cti_callout_again(cti_call_out_param_); } //已经连续两次呼叫失败, 直接返回失败 else { BOOST_LOG_SEV(cia_g_logger, RuntimeInfo) << "业务流水:" << cti_call_out_param_->m_transId << "已经连续两次呼叫失败, 直接返回失败"; ciaMessage msg; msg.set_type(CIA_CALL_RESPONSE); msg.set_transid(cti_call_out_param_->m_transId); msg.set_status(CIA_CALL_FAIL); cti_call_out_param_->m_base_client->do_write(chat_message(msg)); return; } }}
开发者ID:tp316,项目名称:CIACommunicationServerV2,代码行数:57,
示例8: generatestd::unordered_map<std::string, std::list<std::string> >generate(const inclusion_dependencies_builder_factory& f, std::forward_list< boost::shared_ptr< inclusion_dependencies_provider_interface<SmlEntity> > > providers, const SmlEntity& e) { const auto n(sml::string_converter::convert(e.name())); BOOST_LOG_SEV(lg, debug) << "Creating inclusion dependencies for: " << n; std::unordered_map<std::string, std::list<std::string> > r; for (const auto p : providers) { BOOST_LOG_SEV(lg, debug) << "Providing for: " << p->formatter_name(); auto id(p->provide(f, e)); if (!id) continue; id->sort(include_directive_comparer); id->unique(); const auto id_pair(std::make_pair(p->formatter_name(), *id)); const bool inserted(r.insert(id_pair).second); if (!inserted) { BOOST_LOG_SEV(lg, error) << duplicate_formatter_name << p->formatter_name() << " for type: " << n; BOOST_THROW_EXCEPTION(building_error(duplicate_formatter_name + p->formatter_name())); } } BOOST_LOG_SEV(lg, debug) << "Finished creating inclusion dependencies for: " << n; return r;}
开发者ID:pgannon,项目名称:dogen,代码行数:37,
示例9: contextvoid workflow::initialise_context_activity(const std::string& model_name, const std::string& external_modules, bool is_target) { context_ = context(); auto& m(context_.model()); m.name(create_name_for_model(model_name, external_modules)); m.original_model_name(model_name); BOOST_LOG_SEV(lg, debug) << "Model name: " << m.name().qualified(); m.origin_type(yarn::origin_types::user); m.is_target(is_target); const auto mm(create_module_for_model(m.name(), is_target)); m.modules().insert(std::make_pair(mm.name().qualified(), mm));}
开发者ID:memsharded,项目名称:dogen,代码行数:15,
示例10: calculateGradientSecond Scalar calculateGradientSecond(const E::MatrixBase<DerivedA>& point, const E::MatrixBase<DerivedB>& segment, const E::MatrixBase<DerivedC>& dsegment) { const Vector3 d_cross = - (dsegment.template head<3>().cross(v02) + v01.cross(dsegment.template tail<3>())); const Vector3 d_v12 = dsegment.template head<3>() - dsegment.template tail<3>(); const Scalar res = cross.dot(d_cross)/(cross_n*v12_n) - v12.dot(d_v12)*cross_v12_n;#ifdef DCM_USE_LOGGING if(!boost::math::isfinite(res)) BOOST_LOG_SEV(log, error) << "Unnormal second cluster gradient detected: "<<res <<" with point: "<<point.transpose()<<", segment: "<<segment.transpose() << "and dsegment: "<<dsegment.transpose();#endif return res; };
开发者ID:qiangofzju,项目名称:openDCM,代码行数:15,
示例11: HibernationEnabledbool HibernationEnabled(){ #pragma warning (push, 4) #pragma warning( disable : 4800 ) BOOST_LOG_SEV(logger(), debug) << "IsPwrHibernateAllowed(): " << (bool)IsPwrHibernateAllowed(); BOOST_LOG_SEV(logger(), debug) << "IsPwrShutdownAllowed(): " << (bool)IsPwrShutdownAllowed(); BOOST_LOG_SEV(logger(), debug) << "IsPwrSuspendAllowed(): " << (bool)IsPwrSuspendAllowed(); #pragma warning (pop) SYSTEM_POWER_CAPABILITIES systemPowerCapabilities = {0}; if (!GetPwrCapabilities(&systemPowerCapabilities)) { DWORD last_error = GetLastError(); std::string msg = Utilities::MakeString() << "GetPwrCapabilities() failed. Reason: " << last_error; BOOST_LOG_SEV(logger(), error) << msg; return false; } #pragma warning (push, 4) #pragma warning( disable : 4800 ) BOOST_LOG_SEV(logger(), debug) << "systemPowerCapabilities.Hiberboot: " << (bool)systemPowerCapabilities.Hiberboot; #pragma warning (pop) return !!systemPowerCapabilities.Hiberboot;}
开发者ID:MastAvalons,项目名称:aimp-control-plugin,代码行数:24,
示例12: BOOST_LOG_SEVvoid Module3D<Typelist, ID>::type<Sys>::Geometry3D_base<Derived>::set(const T& geometry) { m_geometry = geometry; //first init, so that the geometry internal vector has the right size Base::template init< typename geometry_traits<T>::tag >(); //now write the value; (typename geometry_traits<T>::modell()).template extract<Scalar, typename geometry_traits<T>::accessor >(geometry, Base::getValue());#ifdef DCM_USE_LOGGING BOOST_LOG_SEV(Base::log, information) << "Set global Value: " << Base::getValue().transpose();#endif reset();};
开发者ID:qiangofzju,项目名称:openDCM,代码行数:15,
示例13: qnvoid merger::add_target(const model& target) { const auto qn(target.name().qualified()); require_not_has_target(qn); has_target_ = true; merged_model_.name(target.name()); merged_model_.documentation(target.documentation()); merged_model_.leaves(target.leaves()); merged_model_.modules(target.modules()); merged_model_.references(target.references()); merged_model_.extensions(target.extensions()); merged_model_.is_target(true); BOOST_LOG_SEV(lg, debug) << "added target model: " << qn;}
开发者ID:Niam99,项目名称:dogen,代码行数:15,
示例14: BOOST_LOG_SEVvoid voice_card_control::init_cti(){ BOOST_LOG_SEV(cia_g_logger, RuntimeInfo) << "读取语音卡配置文件"; if (SsmStartCti("ShConfig.ini", "ShIndex.ini") != 0) { show_error(); BOOST_LOG_SEV(cia_g_logger, Critical) << "读取语音卡配置文件失败"; throw std::runtime_error("读取语音卡配置文件失败"); } else{ BOOST_LOG_SEV(cia_g_logger, RuntimeInfo) << "语音卡配置文件读取成功"; } //设置驱动程序抛出事件的模式 EVENT_SET_INFO EventMode; EventMode.dwWorkMode = EVENT_CALLBACK; // 事件回调模式 EventMode.lpHandlerParam = (LPVOID)voice_card_control::cti_callback; // 注册回调函数 SsmSetEvent(0xffff, -1, true, &EventMode); // 启动事件触发模式 //如果要在程序中获取SS7消息, 则需要同时注意以下两点 //配置文件 ShConfig.ini 中, GetMsuOnAutoHandle = 1 //程序中: SsmSetEvent(E_RCV_Ss7Msu, -1, true, &EventMode); SsmSetEvent(E_RCV_Ss7Msu, -1, true, &EventMode); BOOST_LOG_SEV(cia_g_logger, RuntimeInfo) << "正在初始化语音卡通道, 预期耗时15秒"; // 为了兼容1号信令,注释以下代码,改为sleep 15秒 //while (SsmSearchIdleCallOutCh(160, 0x1E0000) < 0){ // 循环等待, 直到能够获取语音卡空闲通道号, 语音卡初始化完毕 // boost::this_thread::sleep_for(boost::chrono::milliseconds(500)); //} boost::this_thread::sleep_for(boost::chrono::seconds(15)); BOOST_LOG_SEV(cia_g_logger, RuntimeInfo) << "语音卡通道初始化完毕"; for (std::size_t i = 0; i < m_numChannelCount; i++){ m_channel_queue.put(i); }}
开发者ID:ciaapp,项目名称:CIACommunicationServerV2,代码行数:36,
示例15: arv_camera_set_region bool CameraGigeAravis::setSize(int width, int height, bool customSize) { if(customSize) { arv_camera_set_region(camera, 0, 0,width,height); arv_camera_get_region (camera, NULL, NULL, &mWidth, &mHeight); BOOST_LOG_SEV(logger, notification) << "Camera region size : " << mWidth << "x" << mHeight; // Default is maximum size }else { int sensor_width, sensor_height; arv_camera_get_sensor_size(camera, &sensor_width, &sensor_height); BOOST_LOG_SEV(logger, notification) << "Camera sensor size : " << sensor_width << "x" << sensor_height; arv_camera_set_region(camera, 0, 0,sensor_width,sensor_height); arv_camera_get_region (camera, NULL, NULL, &mWidth, &mHeight); } return true; }
开发者ID:Asubayo,项目名称:freeture,代码行数:24,
示例16: BOOST_LOG_SEVvoid injector::inject_visitors(intermediate_model& m) { BOOST_LOG_SEV(lg, debug) << "Injecting visitors."; std::list<visitor> visitors; for (auto& pair : m.objects()) { auto& o(pair.second); if (!o.is_visitable()) continue; if (o.leaves().empty()) { const auto qn(o.name().qualified()); BOOST_LOG_SEV(lg, error) << zero_leaves << qn; BOOST_THROW_EXCEPTION(injection_error(zero_leaves + qn)); } const auto v(create_visitor(o, o.leaves())); inject_visitable_by(o, o.leaves(), v.name(), m); visitors.push_back(v); } for (const auto v : visitors) { BOOST_LOG_SEV(lg, debug) << "Adding visitor: " << v.name().qualified(); const auto pair(std::make_pair(v.name().qualified(), v)); const auto i(m.visitors().insert(pair)); if (!i.second) { const auto qn(v.name().qualified()); BOOST_LOG_SEV(lg, error) << duplicate_name << qn; BOOST_THROW_EXCEPTION(injection_error(duplicate_name + qn)); } } BOOST_LOG_SEV(lg, debug) << "Done injecting visitors.";}
开发者ID:memsharded,项目名称:dogen,代码行数:36,
示例17: validate_current_elementlayer hydrator::read_layer() { validate_current_element(dia_layer); layer layer; layer.name(read_xml_string_attribute(dia_name)); layer.visible(try_read_xml_bool_attribute(dia_layer_visible)); layer.active(try_read_xml_bool_attribute(dia_layer_active)); BOOST_LOG_SEV(lg, debug) << "Reading layer: " << layer.name(); std::vector<object> objects; const bool is_self_closing(reader_.is_empty()); reader_.read(); if (!is_self_closing) { do { objects.push_back(read_object()); } while (!is_end_element(dia_layer)); reader_.read(); } layer.objects(objects); BOOST_LOG_SEV(lg, debug) << "Read layer: " << layer.name(); return layer;}
开发者ID:memsharded,项目名称:dogen,代码行数:24,
示例18: calculateGradientFirst Scalar calculateGradientFirst(const E::MatrixBase<DerivedA>& point, const E::MatrixBase<DerivedB>& segment, const E::MatrixBase<DerivedC>& dpoint) { const Vector3 d_point = dpoint; //eigen only acceppts vector3 for cross product const Vector3 d_cross = d_point.cross(v02) + v01.cross(d_point); const Scalar res = cross.dot(d_cross)/(cross_n*v12_n);#ifdef DCM_USE_LOGGING if(!boost::math::isfinite(res)) BOOST_LOG_SEV(log, error) << "Unnormal first cluster gradient detected: "<<res <<" with point: "<<point.transpose()<<", segment: "<<segment.transpose() <<" and dpoint: "<<dpoint.transpose();#endif return res; };
开发者ID:qiangofzju,项目名称:openDCM,代码行数:15,
示例19: BOOST_LOG_SEVbool Linklet::messageParsed(Message &msg){ if (m_state == State::IntroWait) { // We have received the hello message, extract information and detach Protocol::Interplex::Hello hello = message_cast<Protocol::Interplex::Hello>(msg); Contact peerContact = Contact::fromMessage(hello.local_contact()); if (peerContact.isNull()) { BOOST_LOG_SEV(m_logger, log::error) << "Invalid peer contact in hello message!"; return false; } m_peerContact = peerContact; // Perform additional verification on the peer before transitioning into // the connected state if (!signalVerifyPeer(shared_from_this()) || !m_manager.verifyPeer(peerContact)) { BOOST_LOG_SEV(m_logger, log::error) << "Peer verificaton has failed!"; return false; } BOOST_LOG_SEV(m_logger, log::normal) << "Introductory phase with " << peerContact.nodeId().hex() << " completed."; m_state = State::Connected; signalConnectionSuccess(shared_from_this()); // The above signal may close this linklet, in this case we should not start reading, // otherwise this will cause a segmentation fault if (m_state != State::Connected) return false; } else { // Payload has been read, emit message and detach signalMessageReceived(shared_from_this(), msg); } msg.detach(); return true;}
开发者ID:kostko,项目名称:unisphere,代码行数:36,
示例20: iformattables::path_derivativesinclusion_directives_factory::path_derivatives_for_formatter_name( const std::unordered_map<std::string, formattables::path_derivatives>& pd, const std::string& formatter_name) const { const auto i(pd.find(formatter_name)); if (i == pd.end()) { BOOST_LOG_SEV(lg, error) << formatter_name_not_found << formatter_name; BOOST_THROW_EXCEPTION( building_error(formatter_name_not_found + formatter_name)); } return i->second;}
开发者ID:Niam99,项目名称:dogen,代码行数:15,
示例21: shared_from_this void NodeVersionLoader::receiveHeader() { auto self = shared_from_this(); checkThread(); auto& item = currentDownloadItem(); state = State::ReceivingHeader; auto buf = std::make_shared<std::uint64_t>(); timer.expires_from_now(boost::posix_time::seconds(8)); timer.async_wait([this, self] (const error_code& error) { if (error) { return; } if (disposed) { return; } if (state == State::ReceivingHeader) { BOOST_LOG_SEV(log, LogLevel::Warn) << "Timed out."; socket.cancel(); } }); asio::async_read(socket, asio::buffer(buf.get(), 8), [this, self, &item, buf](const error_code& error, std::size_t) { checkThread(); if (disposed) { downloadCancelled(); return; } if (error) { downloadFailed(error.message()); return; } timer.cancel(); auto size = *buf; if (size == 0) { downloadFailed("Version cannot be downloaded for some reason."); return; } receiveData(size); }); }
开发者ID:yvt,项目名称:Merlion,代码行数:48,
注:本文中的BOOST_LOG_SEV函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ BOOST_MPI_CHECK_RESULT函数代码示例 C++ BOOST_LOG_FUNCTION函数代码示例 |