本文整理汇总了C++中LOG_MESSAGE函数的典型用法代码示例。如果您正苦于以下问题:C++ LOG_MESSAGE函数的具体用法?C++ LOG_MESSAGE怎么用?C++ LOG_MESSAGE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LOG_MESSAGE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: OBTAIN_MESSAGE
RequestProcessorResponseStatus RequestProcessor::ProcessSubscribeKeepalive(Envelope &request, vector<Envelope> &output)
{
OBTAIN_MESSAGE(protocol::request::SubscribeKeepaliveV1, m, request, 0);
{
::zippylog::request_processor::ForwardSubscribeKeepalive log;
/// @todo support multiple ids
log.set_subscription(m->id(0));
LOG_MESSAGE(log, this->logger_sock);
}
/// @todo validation
LOG_END:
RequestProcessorHandlerResult result = this->impl->HandleSubscribeKeepalive(request, output);
if (result.deferred)
return DEFERRED;
return AUTHORITATIVE;
}
开发者ID:Fantasticer,项目名称:zippylog,代码行数:21,代码来源:request_processor.cpp
示例2: SaveGameFile
void SaveGameManager::parseScript(Ogre::DataStreamPtr &stream, const Ogre::String &groupName)
{
Ogre::String name = stream->getName();
name = name.substr(0, name.length()-5); //delete ".save" at the and of the name
int pointpos = name.find_last_of(".");
name = name.substr(0, pointpos);
if(Ogre::StringConverter::isNumber(name))
{
mHighestSaveGameNumber = std::max(mHighestSaveGameNumber, Ogre::StringConverter::parseInt(name));
SaveGameFile* file = new SaveGameFile("", Ogre::StringConverter::parseInt(name));
LOG_MESSAGE(Logger::RULES, "Parsing header of save game: " + name + ".save");
SaveGameFileReader reader;
reader.parseSaveGameFileHeader(stream, groupName, file);
if(file->getProperty(SaveGameFile::PROPERTY_MODULEID) != "") // broken save game
mSaveGames[Ogre::StringConverter::parseInt(name)] = file;
}
}
开发者ID:BackupTheBerlios,项目名称:dsa-hl-svn,代码行数:21,代码来源:SaveGameManager.cpp
示例3: cmd_trace_unset
// "trace unset" console command.
void cmd_trace_unset(void) {
int i, argc;
const char *arg;
const char *api;
TRACE_RESULT ret;
argc=CMD_ARGC();
if(argc < 3) {
LOG_CONSOLE(PLID, "usage: trace unset <routine>");
return;
}
for(i=1; i < argc; i++) {
arg=CMD_ARGV(i);
ret=trace_setflag(&arg, mFALSE, &api);
if(ret==TR_SUCCESS)
LOG_MESSAGE(PLID, "Un-Tracing %s routine '%s'", api, arg);
else if(ret==TR_ALREADY)
LOG_CONSOLE(PLID, "Already not tracing %s routine '%s'", api, arg);
else
LOG_CONSOLE(PLID, "Unrecognized API routine '%s'", arg);
}
}
开发者ID:jkivilin,项目名称:metamod-p,代码行数:22,代码来源:trace_api.cpp
示例4: TRACK_MESSAGE
void Connection::internalSend(OutputMessage_ptr msg)
{
TRACK_MESSAGE(msg);
try{
++m_pendingWrite;
m_writeTimer.expires_from_now(boost::posix_time::seconds(Connection::write_timeout));
m_writeTimer.async_wait( boost::bind(&Connection::handleWriteTimeout, boost::weak_ptr<Connection>(shared_from_this()),
boost::asio::placeholders::error));
boost::asio::async_write(getHandle(),
boost::asio::buffer(msg->getOutputBuffer(), msg->getMessageLength()),
boost::bind(&Connection::onWriteOperation, shared_from_this(), msg, boost::asio::placeholders::error));
}
catch(boost::system::system_error& e){
if(m_logError){
LOG_MESSAGE("NETWORK", LOGTYPE_ERROR, 1, e.what());
m_logError = false;
}
}
}
开发者ID:angeliker,项目名称:OTHire,代码行数:21,代码来源:connection.cpp
示例5: handleReadError
void Connection::parseHeader(const boost::system::error_code& error)
{
m_connectionLock.lock();
m_readTimer.cancel();
int32_t size = m_msg.decodeHeader();
if (error || size <= 0 || size >= NETWORKMESSAGE_MAXSIZE - 16) {
handleReadError(error);
}
if (m_connectionState != CONNECTION_STATE_OPEN || m_readError) {
closeConnection();
m_connectionLock.unlock();
return;
}
--m_pendingRead;
try {
++m_pendingRead;
m_readTimer.expires_from_now(boost::posix_time::seconds(Connection::read_timeout));
m_readTimer.async_wait( boost::bind(&Connection::handleReadTimeout, boost::weak_ptr<Connection>(shared_from_this()),
boost::asio::placeholders::error));
// Read packet content
m_msg.setMessageLength(size + NetworkMessage::header_length);
boost::asio::async_read(getHandle(), boost::asio::buffer(m_msg.getBodyBuffer(), size),
boost::bind(&Connection::parsePacket, shared_from_this(), boost::asio::placeholders::error));
} catch (boost::system::system_error& e) {
if (m_logError) {
LOG_MESSAGE("NETWORK", LOGTYPE_ERROR, 1, e.what());
m_logError = false;
}
closeConnection();
}
m_connectionLock.unlock();
}
开发者ID:nclx,项目名称:forgottenserver,代码行数:40,代码来源:connection.cpp
示例6: mRootBone
PhysicsRagDoll::PhysicsRagDoll(const Ogre::String& ragdollResource, Actor* actor) :
mRootBone(NULL),
mNode(NULL),
mWorld(NULL),
mMesh(NULL),
mSkeleton(NULL)
{
mRootBone = NULL;
mNode = actor->_getSceneNode();
mWorld = PhysicsManager::getSingleton()._getNewtonWorld();
if (!actor->getControlledObject()->isMeshObject())
Throw(IllegalArgumentException, "PhysicsRagDoll::PhysicsRagDoll needs a Mesh-Actor as argument!");
MeshObject* meshObj = static_cast<MeshObject*>(actor->getControlledObject());
// stop all animations
meshObj->stopAllAnimations();
// get the skeleton.
mSkeleton = meshObj->getEntity()->getSkeleton();
// get the mesh.
mMesh = meshObj->getEntity()->getMesh();
LOG_MESSAGE(Logger::CORE, "Loading ragdoll '" + ragdollResource + "'");
TiXmlDocument* doc = loadDocument(ragdollResource);
if (!doc)
{
LOG_ERROR(Logger::CORE, "Ragdoll resource '" + ragdollResource + "' not found");
}
else
{
TiXmlElement* dataDocumentContent = doc->RootElement();
mRootBone =_addAllBones(NULL, getChildNamed(dataDocumentContent, "Bone"), actor);
}
}
开发者ID:BackupTheBerlios,项目名称:dsa-hl-svn,代码行数:39,代码来源:PhysicsRagDoll.cpp
示例7: initDumb
/* ModMusic::loadFromMemory
* Loads mod data for playback
*******************************************************************/
bool ModMusic::loadFromMemory(const uint8_t* data, const uint32_t size)
{
// Init DUMB if needed
if (!init_done)
initDumb();
// Close current module if any
close();
// Load module file
dumb_module = dumb_read_any(dumbfile_open_memory((const char*)data, size), 0, 0);
if (dumb_module != NULL)
{
initialize(2, 44100);
return true;
}
else
{
LOG_MESSAGE(1, "Failed to load module music data");
return false;
}
}
开发者ID:devinacker,项目名称:SLADE,代码行数:25,代码来源:ModMusic.cpp
示例8: NOVA_EXP
CMaterialPtr CMaterialManager::CreateMaterial(nstring & name, nstring & group,
nova::CColorRGB AmbientColor,
nova::CColorRGB DiffuseColor,
nova::CColorRGB SpecularColor,
nReal Shininess,
nReal Transparency,
nstring TexMap,
nstring MultiTexMap,
nstring SpecMap,
nstring BumpMap,
nstring ReflectionMap,
CResource::TAttach state)
{
CMaterialPtr mat = CResourceManager::AddNewResource(name, group, state);
if(mat.IsNull())
throw NOVA_EXP("CMaterialManager::CreateMaterial - resource factory return \
Null pointer...", MEM_ERROR);
mat->SetAmbientColor(AmbientColor);
mat->SetDiffuseColor(DiffuseColor);
mat->SetSpecularColor(SpecularColor);
mat->SetShininess(Shininess);
mat->SetTransparency(Transparency);
mat->SetTexMap(TexMap);
mat->SetMultiTexMap(MultiTexMap);
mat->SetSpecMap(SpecMap);
mat->SetBumpMap(BumpMap);
mat->SetReflectionMap(ReflectionMap);
mat->PrepareResource();
mat->BuildResource();
nova::nstringstream str;
str << "Material Factory: material name: " << name << " group: " << group << " created..";
LOG_MESSAGE(str.str());
return mat;
}
开发者ID:testsirius,项目名称:NovaEngine,代码行数:39,代码来源:nova_material.cpp
示例9: catch
void Connection::closeSocket()
{
m_connectionLock.lock();
if (m_socket->is_open()) {
m_pendingRead = 0;
m_pendingWrite = 0;
try {
boost::system::error_code error;
m_socket->shutdown(boost::asio::ip::tcp::socket::shutdown_both, error);
m_socket->close(error);
} catch (boost::system::system_error& e) {
if (m_logError) {
LOG_MESSAGE("NETWORK", LOGTYPE_ERROR, 1, e.what());
m_logError = false;
}
}
}
m_connectionLock.unlock();
}
开发者ID:nclx,项目名称:forgottenserver,代码行数:22,代码来源:connection.cpp
示例10: defined
void CTKRepeat::TestKeyboardRepeatRateL(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime)
{
do
{
#if defined(LOGGING)
const TInt KOneSec=1000000;
const TInt KOneHundrethSec=KOneSec/100;
TLogMessageText logMessageText;
_LIT(KRepeatRate,"Repeat Rate Initial=%d.%02dsecs, Subsequent=%d.%02dsecs");
logMessageText.Format(KRepeatRate,aInitialTime.Int()/KOneSec,(aInitialTime.Int()%KOneSec)/KOneHundrethSec
,aTime.Int()/KOneSec,(aTime.Int()%KOneSec)/KOneHundrethSec);
LOG_MESSAGE(logMessageText);
#endif
TheClient->iWs.SetKeyboardRepeatRate(aInitialTime, aTime);
iWin->SetKeyboardRepeatRate(aInitialTime, aTime);
CActiveScheduler::Start();
if (iAbort)
{
iTest->AbortL();
}
} while(CheckReportL());
}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:22,代码来源:TKRepeat.CPP
示例11: LOG_MESSAGE
/* MapSpecials::processZDoomLineSpecial
* Process ZDoom line special
*******************************************************************/
void MapSpecials::processZDoomLineSpecial(MapLine* line)
{
// Get special
int special = line->getSpecial();
if (special == 0)
return;
// Get parent map
SLADEMap* map = line->getParentMap();
// Get args
int args[5];
for (unsigned arg = 0; arg < 5; arg++)
args[arg] = line->intProperty(S_FMT("arg%d", arg));
// --- TranslucentLine ---
if (special == 208)
{
// Get tagged lines
vector<MapLine*> tagged;
if (args[0] > 0)
map->getLinesById(args[0], tagged);
else
tagged.push_back(line);
// Get args
double alpha = (double)args[1] / 255.0;
string type = (args[2] == 0) ? "translucent" : "add";
// Set transparency
for (unsigned l = 0; l < tagged.size(); l++)
{
tagged[l]->setFloatProperty("alpha", alpha);
tagged[l]->setStringProperty("renderstyle", type);
LOG_MESSAGE(3, S_FMT("Line %d translucent: (%d) %1.2f, %s", tagged[l]->getIndex(), args[1], alpha, CHR(type)));
}
}
}
开发者ID:Talon1024,项目名称:SLADE,代码行数:42,代码来源:MapSpecials.cpp
示例12: tmp
void ServicePort::open(IPAddressList ips, uint16_t port)
{
m_pendingStart = false;
m_serverPort = port;
bool error = false;
IPAddressList pendingIps;
for(IPAddressList::iterator it = ips.begin(); it != ips.end(); ++it)
{
try
{
Acceptor_ptr tmp(new boost::asio::ip::tcp::acceptor(m_io_service,
boost::asio::ip::tcp::endpoint(*it, m_serverPort)));
tmp->set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
tmp->set_option(boost::asio::ip::tcp::no_delay(true));
accept(tmp);
m_acceptors[tmp] = *it;
}
catch(std::exception& e)
{
if(m_logError)
{
LOG_MESSAGE(LOGTYPE_ERROR, e.what(), "NETWORK")
pendingIps.push_back(*it);
if(!error)
error = true;
}
}
}
if(error)
{
m_logError = false;
m_pendingStart = true;
Scheduler::getInstance().addEvent(createSchedulerTask(5000, boost::bind(
&ServicePort::services, boost::weak_ptr<ServicePort>(shared_from_this()), pendingIps, m_serverPort)));
}
}
开发者ID:081421,项目名称:otxserver,代码行数:39,代码来源:server.cpp
示例13: Meta_Query
C_DLLEXPORT int Meta_Query(char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs)
{
// this function is the first function ever called by metamod in the plugin DLL. Its purpose
// is for metamod to retrieve basic information about the plugin, such as its meta-interface
// version, for ensuring compatibility with the current version of the running metamod.
// keep track of the pointers to metamod function tables metamod gives us
gpMetaUtilFuncs = pMetaUtilFuncs;
*pPlugInfo = &Plugin_info;
// check for interface version compatibility
if (strcmp(ifvers, Plugin_info.ifvers) != 0)
{
int mmajor = 0, mminor = 0, pmajor = 0, pminor = 0;
LOG_CONSOLE(PLID, "%s: meta-interface version mismatch (metamod: %s, %s: %s)", Plugin_info.name, ifvers, Plugin_info.name, Plugin_info.ifvers);
LOG_MESSAGE(PLID, "%s: meta-interface version mismatch (metamod: %s, %s: %s)", Plugin_info.name, ifvers, Plugin_info.name, Plugin_info.ifvers);
// if plugin has later interface version, it's incompatible (update metamod)
sscanf (ifvers, "%d:%d", &mmajor, &mminor);
sscanf (META_INTERFACE_VERSION, "%d:%d", &pmajor, &pminor);
if (pmajor > mmajor || (pmajor == mmajor && pminor > mminor))
{
LOG_CONSOLE(PLID, "metamod version is too old for this plugin; update metamod");
LOG_ERROR(PLID, "metamod version is too old for this plugin; update metamod");
}
// if plugin has older major interface version, it's incompatible (update plugin)
else if (pmajor < mmajor)
{
LOG_CONSOLE(PLID, "metamod version is incompatible with this plugin; please find a newer version of this plugin");
LOG_ERROR(PLID, "metamod version is incompatible with this plugin; please find a newer version of this plugin");
}
}
return TRUE; // tell metamod this plugin looks safe
}
开发者ID:CecilHarvey,项目名称:yapb,代码行数:39,代码来源:meta_api.cpp
示例14: startAspirationSearch
Move AspirationSearch::chooseMove(GameState& gameState)
{
transpositionTable.clear(); // clean up data from previous searches
#ifdef GATHER_STATISTICS
nodesVisited = 0;
Timer timer;
timer.start();
Move moveToPlay = startAspirationSearch(gameState);
timer.stop();
#ifdef LOG_STATS_PER_TURN
if(gameState.getCurrentPlayer() == EPlayerColors::Type::BLACK_PLAYER)
{
LOG_MESSAGE(StringBuilder() << "Aspiration Search engine searching move for Black Player")
}
else
{
LOG_MESSAGE(StringBuilder() << "Aspiration Search engine searching move for White Player")
}
LOG_MESSAGE(StringBuilder() << "Search depth: " << searchDepth)
LOG_MESSAGE(StringBuilder() << "Number of nodes visited: " << nodesVisited)
LOG_MESSAGE(StringBuilder() << "Time spent: " << timer.getElapsedTimeInMilliSec() << " ms")
LOG_MESSAGE(StringBuilder() << "% of Transposition Table entries used: " << ((double)transpositionTable.getNumEntriesUsed() / (TRANSPOSITION_TABLE_NUM_ENTRIES * 2.0)))
LOG_MESSAGE(StringBuilder() << "% of Transposition Table entries replaced: " << ((double)transpositionTable.getNumReplacementsRequired() / (TRANSPOSITION_TABLE_NUM_ENTRIES * 2.0)))
LOG_MESSAGE("")
#endif // LOG_STATS_PER_TURN
#ifdef LOG_STATS_END_OF_MATCH
totalNodesVisited += nodesVisited;
totalTimeSpent += timer.getElapsedTimeInMilliSec();
++turnsPlayed;
#endif // LOG_STATS_END_OF_MATCH
return moveToPlay;
#else
return startAspirationSearch(gameState);
#endif // GATHER_STATISTICS
}
开发者ID:DennisSoemers,项目名称:SerPrunesALot,代码行数:40,代码来源:AspirationSearch.cpp
示例15: catch
void ServicePort::accept()
{
if(!m_acceptor){
#ifdef __DEBUG_NET__
std::cout << "Error: [ServerPort::accept] NULL m_acceptor." << std::endl;
#endif
return;
}
try{
boost::asio::ip::tcp::socket* socket = new boost::asio::ip::tcp::socket(m_io_service);
m_acceptor->async_accept(*socket,
boost::bind(&ServicePort::onAccept, this, socket,
boost::asio::placeholders::error));
}
catch(boost::system::system_error& e){
if(m_logError){
LOG_MESSAGE("NETWORK", LOGTYPE_ERROR, 1, e.what());
m_logError = false;
}
}
}
开发者ID:Nottinghster,项目名称:OTServ_SVN-0.6.4,代码行数:23,代码来源:server.cpp
示例16: prepareServerAddress
int prepareServerAddress(char* address, int port, struct sockaddr_in * server_addr)
{
memset((char *) server_addr , 0, sizeof(struct sockaddr_in));
if (address != NULL) {
struct hostent *server;
server = gethostbyname(address);
if (server == NULL) {
LOG_MESSAGE("could not find server host by name %s\n", address);
return -1;
}
memcpy((char *) &(server_addr->sin_addr.s_addr), (char *) server->h_addr, server->h_length);
}
else
server_addr->sin_addr.s_addr = htonl(INADDR_ANY);
server_addr->sin_family = AF_INET;
server_addr->sin_port = htons(port);
return 0;
}
开发者ID:fcovatti,项目名称:iccp,代码行数:23,代码来源:comm.c
示例17: mVisible
AbstractWindow::AbstractWindow(const CeGuiString& xmlfile, int inputType, bool closeOnEscape, bool modal)
: mVisible(false),
mModal(modal),
mWindowInputType(inputType),
mCloseOnEscape(closeOnEscape)
{
LOG_MESSAGE(Logger::UI,
"Lade Fenster '" + Ogre::String(xmlfile.c_str()) + "'");
mWindow = AbstractWindow::loadWindow(xmlfile, mNamePrefix);
if (mWindow == NULL)
{
Throw(rl::IllegalStateException, Ogre::String("Could not load window '")+xmlfile.c_str()+"'.");
}
getRoot()->addChildWindow(mWindow);
if (modal)
{
mWindow->setModalState(true);
mWindow->setAlwaysOnTop(true);
mWindow->moveToFront();
mWindow->show();
}
else
{
mWindow->hide();
}
mNormalAlpha = mWindow->getAlpha();
mName = mWindow->getName();
WindowManager::getSingleton().registerWindow(this);
mWindow->subscribeEvent(Window::EventActivated,
boost::bind(
&rl::WindowManager::handleMovedToFront,
rl::WindowManager::getSingletonPtr(),
this));
}
开发者ID:BackupTheBerlios,项目名称:dsa-hl-svn,代码行数:37,代码来源:AbstractWindow.cpp
示例18: LOG_MESSAGE
/* UndoManager::undo
* Performs an undo operation
*******************************************************************/
string UndoManager::undo()
{
// Can't while currently recording
if (current_level)
return "";
// Can't if no more levels to undo
if (current_level_index < 0)
return "";
// Perform undo level
undo_running = true;
current_undo_manager = this;
UndoLevel* level = undo_levels[current_level_index];
if (!level->doUndo())
LOG_MESSAGE(3, "Undo operation \"%s\" failed", level->getName());
undo_running = false;
current_undo_manager = NULL;
current_level_index--;
announce("undo");
return level->getName();
}
开发者ID:DemolisherOfSouls,项目名称:SLADE,代码行数:27,代码来源:UndoRedo.cpp
示例19: ZeroMemory
CAuthHelperTest::UserInfo CAuthHelperTest::getCurrentUser()
{
UserInfo userInfo;
#ifdef _WIN_
TCHAR pszUname[100];
ZeroMemory(pszUname, sizeof(pszUname));
DWORD dwSize = 100;
if (GetUserName(pszUname, &dwSize))
userInfo.name = UTF16SZ_2QSTR(pszUname, dwSize-1);
else
LOG_MESSAGE(DBG_FATAL, "Couldn't to extract user name. Error code: %d", GetLastError());
#else
#endif
return userInfo;
}
开发者ID:Lantame,项目名称:prl-disp-service,代码行数:24,代码来源:CAuthHelperTest.cpp
示例20: shared_from_this
void Connection::accept()
{
try
{
++m_pendingRead;
m_readTimer.expires_from_now(boost::posix_time::seconds(Connection::readTimeout));
m_readTimer.async_wait(boost::bind(&Connection::handleReadTimeout,
boost::weak_ptr<Connection>(shared_from_this()), boost::asio::placeholders::error));
// Read size of the first packet
boost::asio::async_read(getHandle(),
boost::asio::buffer(m_msg.buffer(), NETWORK_HEADER_SIZE),
boost::bind(&Connection::parseHeader, shared_from_this(), boost::asio::placeholders::error));
}
catch(boost::system::system_error& e)
{
if(m_logError)
{
LOG_MESSAGE(LOGTYPE_ERROR, e.what(), "NETWORK");
m_logError = false;
close();
}
}
}
开发者ID:alexisjojo,项目名称:darkkonia,代码行数:24,代码来源:connection.cpp
注:本文中的LOG_MESSAGE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论