当前位置: 首页>>代码示例>>C++>>正文


C++ BOOST_LOG_SEV函数代码示例

本文整理汇总了C++中BOOST_LOG_SEV函数的典型用法代码示例。如果您正苦于以下问题:C++ BOOST_LOG_SEV函数的具体用法?C++ BOOST_LOG_SEV怎么用?C++ BOOST_LOG_SEV使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了BOOST_LOG_SEV函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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,代码来源:distance.hpp

示例2: uds

bool 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,代码来源:generalization_indexer.cpp

示例3: main

int 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,代码来源:sinks_syslog.cpp

示例4: validate

std::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,代码来源:instantiator.cpp

示例5: make_configuration

helper_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,代码来源:helper_expander.cpp

示例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,代码来源:Master.cpp

示例7: catch

void 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,代码来源:voice_card_control.hpp

示例8: generate

std::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,代码来源:inclusion_dependencies_factory.cpp

示例9: context

void 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,代码来源:workflow.cpp

示例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,代码来源:distance.hpp

示例11: HibernationEnabled

bool 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,代码来源:power_management.cpp

示例12: BOOST_LOG_SEV

void 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,代码来源:geometry3d_imp.hpp

示例13: qn

void 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,代码来源:merger.cpp

示例14: BOOST_LOG_SEV

void 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,代码来源:voice_card_control.hpp

示例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,代码来源:CameraGigeAravis.cpp


注:本文中的BOOST_LOG_SEV函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。