本文整理匯總了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;
};
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
}
示例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;
}
示例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));
}
示例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;
};
示例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;
}
示例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();
};
示例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;
}
示例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);
}
}
示例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;
}