Skip to content

Commit 3545112

Browse files
committed
up
1 parent cc0cc39 commit 3545112

28 files changed

Lines changed: 71 additions & 70 deletions

‎kbe/src/lib/client_lib/config.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ bool Config::loadConfig(std::string fileName)
6262

6363
if(!xml->isGood())
6464
{
65-
ERROR_MSG(boost::format("Config::loadConfig: load %1% is failed!\n") %
66-
fileName.c_str());
65+
ERROR_MSG(fmt::format("Config::loadConfig: load {} is failed!\n",
66+
fileName.c_str()));
6767

6868
SAFE_RELEASE(xml);
6969
return false;
@@ -314,8 +314,8 @@ void Config::writeAccountName(const char* name)
314314

315315
if(!xml->isGood())
316316
{
317-
ERROR_MSG(boost::format("Config::writeAccountName: load %1% is failed!\n") %
318-
fileName_.c_str());
317+
ERROR_MSG(fmt::format("Config::writeAccountName: load %1% is failed!\n",
318+
fileName_.c_str()));
319319

320320
SAFE_RELEASE(xml);
321321
return;

‎kbe/src/lib/dbmgr_lib/db_tasks.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ bool DBTaskBase::process()
3636
uint64 duration = startTime - initTime_;
3737
if(duration > stampsPerSecond())
3838
{
39-
WARNING_MSG(boost::format("DBTask::process(): delay %.2f seconds, try adjusting the kbengine_defs.xml(numConnections)!\nsql:(%s)\n") %
40-
(double(duration)/stampsPerSecondD()) % pdbi_->lastquery());
39+
WARNING_MSG(fmt::format("DBTask::process(): delay {0:.2f} seconds, try adjusting the kbengine_defs.xml(numConnections)!\nsql:({1})\n",
40+
(double(duration)/stampsPerSecondD()), pdbi_->lastquery()));
4141
}
4242

4343
duration = timestamp() - startTime;
4444
if (duration > stampsPerSecond())
4545
{
46-
WARNING_MSG(boost::format("DBTask::process(): took %.2f seconds\nsql:(%s)\n") %
47-
(double(duration)/stampsPerSecondD()) % pdbi_->lastquery());
46+
WARNING_MSG(fmt::format("DBTask::process(): took {0:.2f} seconds\nsql:({})\n",
47+
(double(duration)/stampsPerSecondD()), pdbi_->lastquery()));
4848
}
4949

5050
return ret;

‎kbe/src/lib/entitydef/entity_mailbox.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ PyObject* EntityMailbox::__unpickle__(PyObject* self, PyObject* args)
250250
ScriptDefModule* sm = EntityDef::findScriptModule(utype);
251251
if(sm == NULL)
252252
{
253-
ERROR_MSG(boost::format("EntityMailbox::__unpickle__: not found utype %1%!\n") % utype);
253+
ERROR_MSG(fmt::format("EntityMailbox::__unpickle__: not found utype {}!\n", utype));
254254
S_Return;
255255
}
256256

‎kbe/src/lib/entitydef/entitymailboxabstract.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ void EntityMailboxAbstract::newMail(Mercury::Bundle& bundle)
9696
}
9797
else
9898
{
99-
ERROR_MSG(boost::format("EntityMailboxAbstract::newMail: not found component(%1%)!\n")
100-
% componentID_);
99+
ERROR_MSG(fmt::format("EntityMailboxAbstract::newMail: not found component({})!\n",
100+
componentID_));
101101
}
102102
}
103103

@@ -140,8 +140,8 @@ bool EntityMailboxAbstract::postMail(Mercury::Bundle& bundle)
140140
}
141141
else
142142
{
143-
ERROR_MSG(boost::format("EntityMailboxAbstract::postMail: invalid channel(%1%)!\n") %
144-
addr_.c_str());
143+
ERROR_MSG(fmt::format("EntityMailboxAbstract::postMail: invalid channel({})!\n",
144+
addr_.c_str()));
145145
}
146146

147147
return false;

‎kbe/src/lib/entitydef/method.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ PyObject* MethodDescription::createFromStream(MemoryStream* mstream)
208208

209209
if(pyitem == NULL)
210210
{
211-
WARNING_MSG(boost::format("MethodDescription::createFromStream:%1% arg[%2%][%3%] is NULL.\n") %
212-
this->getName() % index % argTypes_[index]->getName());
211+
WARNING_MSG(fmt::format("MethodDescription::createFromStream:{} arg[{}][{}] is NULL.\n",
212+
this->getName(), index, argTypes_[index]->getName()));
213213
}
214214

215215
PyTuple_SET_ITEM(&*pyArgsTuple, index + offset, pyitem);

‎kbe/src/lib/entitydef/property.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ PropertyDescription::PropertyDescription(ENTITY_PROPERTY_UID utype,
8282

8383
if(dataType == NULL)
8484
{
85-
ERROR_MSG(boost::format("PropertyDescription::PropertyDescription: %1% DataType is NULL, in property[%2%].\n") %
86-
dataTypeName.c_str() % name_.c_str());
85+
ERROR_MSG(fmt::format("PropertyDescription::PropertyDescription: {} DataType is NULL, in property[{}].\n",
86+
dataTypeName.c_str(), name_.c_str()));
8787
}
8888
}
8989

‎kbe/src/lib/entitydef/remote_entity_method.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ PyObject* RemoteEntityMethod::tp_call(PyObject* self, PyObject* args,
6565
RemoteEntityMethod* rmethod = static_cast<RemoteEntityMethod*>(self);
6666
MethodDescription* methodDescription = rmethod->getDescription();
6767
EntityMailboxAbstract* mailbox = rmethod->getMailbox();
68-
// DEBUG_MSG(boost::format("RemoteEntityMethod::tp_call:%1%.\n") % methodDescription->getName());
68+
// DEBUG_MSG(fmt::format("RemoteEntityMethod::tp_call:{}.\n"), methodDescription->getName()));
6969

7070
if(methodDescription->checkArgs(args))
7171
{
@@ -83,8 +83,8 @@ PyObject* RemoteEntityMethod::tp_call(PyObject* self, PyObject* args,
8383
}
8484
else
8585
{
86-
ERROR_MSG(boost::format("RemoteEntityMethod::tp_call:%1% checkArgs is error!\n") %
87-
methodDescription->getName());
86+
ERROR_MSG(fmt::format("RemoteEntityMethod::tp_call:{} checkArgs is error!\n",
87+
methodDescription->getName()));
8888
}
8989

9090
S_Return;

‎kbe/src/lib/helper/profile_handler.cpp‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ void CProfileHandler::sendStream(MemoryStream* s)
147147
Mercury::Channel* pChannel = networkInterface_.findChannel(addr_);
148148
if(pChannel == NULL)
149149
{
150-
WARNING_MSG(boost::format("CProfileHandler::sendStream: not found %1% addr(%2%)\n") %
151-
name_ % addr_.c_str());
150+
WARNING_MSG(fmt::format("CProfileHandler::sendStream: not found {} addr({})\n",
151+
name_, addr_.c_str()));
152152
return;
153153
}
154154

@@ -268,8 +268,8 @@ void EventProfileHandler::sendStream(MemoryStream* s)
268268
Mercury::Channel* pChannel = networkInterface_.findChannel(addr_);
269269
if(pChannel == NULL)
270270
{
271-
WARNING_MSG(boost::format("EventProfileHandler::sendStream: not found %1% addr(%2%)\n") %
272-
name_ % addr_.c_str());
271+
WARNING_MSG(fmt::format("EventProfileHandler::sendStream: not found {} addr({})\n",
272+
name_, addr_.c_str()));
273273
return;
274274
}
275275

@@ -376,8 +376,8 @@ void MercuryProfileHandler::sendStream(MemoryStream* s)
376376
Mercury::Channel* pChannel = networkInterface_.findChannel(addr_);
377377
if(pChannel == NULL)
378378
{
379-
WARNING_MSG(boost::format("MercuryProfileHandler::sendStream: not found %1% addr(%2%)\n") %
380-
name_ % addr_.c_str());
379+
WARNING_MSG(fmt::format("MercuryProfileHandler::sendStream: not found {} addr({})\n",
380+
name_, addr_.c_str()));
381381
return;
382382
}
383383

‎kbe/src/lib/navigation/navigation.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ bool Navigation::removeNavigation(std::string name)
5959
navhandles_.erase(iter);
6060
iter->second->decRef();
6161

62-
DEBUG_MSG(boost::format("Navigation::removeNavigation: (%1%) is destroyed!\n") % name);
62+
DEBUG_MSG(fmt::format("Navigation::removeNavigation: ({}) is destroyed!\n", name));
6363
return true;
6464
}
6565

@@ -81,7 +81,7 @@ NavigationHandlePtr Navigation::findNavigation(std::string name)
8181
{
8282
// 由于tile需要做碰撞, 每一个space都需要一份新的数据, 我们这里采用拷贝的方式来增加构造速度
8383
NavTileHandle* pNavTileHandle = new NavTileHandle(*(KBEngine::NavTileHandle*)iter->second.get());
84-
DEBUG_MSG(boost::format("Navigation::findNavigation: copy NavTileHandle(%1%)!\n") % pNavTileHandle);
84+
DEBUG_MSG(fmt::format("Navigation::findNavigation: copy NavTileHandle({:p})!\n", (void*)pNavTileHandle));
8585
return NavigationHandlePtr(pNavTileHandle);
8686
}
8787

‎kbe/src/lib/network/bundle.hpp‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ class Channel;
7171
} \
7272
else \
7373
{ \
74-
DEBUG_MSG(boost::format("%1% %2%:msgID:%3%, currMsgLength:%4%, addr:%5%\n") % \
75-
((isrecv == true) ? "====>" : "<====") % \
76-
pCurrMsgHandler->name.c_str() % \
77-
pCurrMsgHandler->msgID % \
78-
length % \
79-
addr); \
74+
DEBUG_MSG(fmt::format("{} {}:msgID:{}, currMsgLength:{}, addr:{}\n", \
75+
((isrecv == true) ? "====>" : "<===="), \
76+
pCurrMsgHandler->name.c_str(), \
77+
pCurrMsgHandler->msgID, \
78+
length, \
79+
addr)); \
8080
} \
8181
} \
8282
\

0 commit comments

Comments
 (0)