本文整理汇总了C++中LogCategory::debug方法的典型用法代码示例。如果您正苦于以下问题:C++ LogCategory::debug方法的具体用法?C++ LogCategory::debug怎么用?C++ LogCategory::debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogCategory
的用法示例。
在下文中一共展示了LogCategory::debug方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: delete_object
void delete_object(doid_t do_id)
{
m_log->debug() << "Deleting file: " << filename(do_id) << endl;
if(!remove(filename(do_id).c_str()))
{
m_free_ids.insert(m_free_ids.end(), do_id);
update_info();
}
}
示例2: handle_datagram
//.........这里部分代码省略.........
}
catch(std::exception &e)
{
m_log->error() << "Error while unpacking fields, msg may be truncated. e.what(): "
<< e.what() << std::endl;
resp.add_uint32(0);
send(resp);
return;
}
// Check for required fields, and populate with defaults
m_log->spam() << "Checking all required fields exist..." << std::endl;
for(int i = 0; i < dcc->get_num_inherited_fields(); ++i)
{
DCField *field = dcc->get_inherited_field(i);
if(field->is_required() && field->is_db() && !field->as_molecular_field())
{
if(dbo.fields.find(field) == dbo.fields.end())
{
if(!field->has_default_value())
{
m_log->error() << "Field " << field->get_name() << " missing when trying to create "
"object of type " << dcc->get_name();
resp.add_uint32(0);
send(resp);
return;
}
else
{
dbo.fields[field] = field->get_default_value();
}
}
}
}
// Create object in database
m_log->spam() << "Creating stored object..." << std::endl;
unsigned int do_id = m_db_engine->create_object(dbo);
if(do_id == 0 || do_id < m_min_id || do_id > m_max_id)
{
m_log->error() << "Ran out of DistributedObject ids while creating new object." << std::endl;
resp.add_uint32(0);
send(resp);
return;
}
m_log->spam() << "... created with ID: " << do_id << std::endl;
resp.add_uint32(do_id);
send(resp);
}
break;
case DBSERVER_SELECT_STORED_OBJECT_ALL:
{
unsigned int context = dgi.read_uint32();
Datagram resp;
resp.add_server_header(sender, m_control_channel, DBSERVER_SELECT_STORED_OBJECT_ALL_RESP);
resp.add_uint32(context);
unsigned int do_id = dgi.read_uint32();
DatabaseObject dbo;
if(m_db_engine->get_object(do_id, dbo))
{
resp.add_uint8(1);
resp.add_uint16(dbo.dc_id);
resp.add_uint16(dbo.fields.size());
for(auto it = dbo.fields.begin(); it != dbo.fields.end(); ++it)
{
resp.add_uint16(it->first->get_number());
resp.add_data(it->second);
}
}
else
{
resp.add_uint8(0);
}
send(resp);
}
break;
case DBSERVER_DELETE_STORED_OBJECT:
{
if(dgi.read_uint32() == DBSERVER_DELETE_STORED_OBJECT_VERIFY_CODE)
{
unsigned int do_id = dgi.read_uint32();
m_db_engine->delete_object(do_id);
m_log->debug() << "Deleted object with ID: " << do_id << std::endl;
}
else
{
m_log->warning() << "Wrong delete verify code." << std::endl;
}
}
break;
default:
m_log->error() << "Recieved unknown MsgType: " << msg_type << std::endl;
};
}