Skip to content

Commit 245ba2b

Browse files
committed
up
1 parent 1bdbaef commit 245ba2b

5 files changed

Lines changed: 44 additions & 44 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ bool Watchers::addWatcher(const std::string& path, WatcherObject* pwo)
106106

107107
watcherObjs_[pwo->name()].reset(pwo);
108108

109-
//DEBUG_MSG(boost::format("Watchers::addWatcher: path=%1%, name=%2%, id=%3%\n") %
110-
// pwo->path() % pwo->name() % pwo->id());
109+
//DEBUG_MSG(fmt::format("Watchers::addWatcher: path={}, name={}, id={}\n",
110+
// pwo->path(), pwo->name(), pwo->id()));
111111

112112
return true;
113113
}
@@ -119,7 +119,7 @@ bool Watchers::delWatcher(const std::string& name)
119119
return false;
120120

121121
watcherObjs_.erase(name);
122-
DEBUG_MSG(boost::format("Watchers::delWatcher: %1%\n") % name);
122+
DEBUG_MSG(fmt::format("Watchers::delWatcher: {}\n", name));
123123
return true;
124124
}
125125

@@ -331,7 +331,7 @@ bool WatcherPaths::delWatcher(const std::string& fullpath)
331331
{
332332
if(hasWatcher(fullpath) == false)
333333
{
334-
DEBUG_MSG(boost::format("WatcherPaths::delWatcher: not found %1%\n") % fullpath);
334+
DEBUG_MSG(fmt::format("WatcherPaths::delWatcher: not found {}\n", fullpath));
335335
return false;
336336
}
337337

@@ -392,7 +392,7 @@ KBEShared_ptr< WatcherObject > WatcherPaths::getWatcher(const std::string& fullp
392392
{
393393
if(hasWatcher(fullpath) == false)
394394
{
395-
DEBUG_MSG(boost::format("WatcherPaths::delWatcher: not found %1%\n") % fullpath);
395+
DEBUG_MSG(fmt::format("WatcherPaths::delWatcher: not found {}\n", fullpath));
396396
return KBEShared_ptr< WatcherObject > ((WatcherObject*)NULL);
397397
}
398398

‎kbe/src/lib/network/endpoint.cpp‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ int EndPoint::findDefaultInterface(char * name)
258258
}
259259
else
260260
{
261-
ERROR_MSG(boost::format("EndPoint::findDefaultInterface: "
262-
"if_nameindex returned NULL (%1%)\n") %
263-
kbe_strerror());
261+
ERROR_MSG(fmt::format("EndPoint::findDefaultInterface: "
262+
"if_nameindex returned NULL ({})\n",
263+
kbe_strerror()));
264264
}
265265

266266
return ret;
@@ -296,8 +296,8 @@ int EndPoint::findIndicatedInterface(const char * spec, char * name)
296296

297297
if (!ok)
298298
{
299-
ERROR_MSG(boost::format("EndPoint::findIndicatedInterface: "
300-
"netmask match %1% length %2% is not valid.\n") % iftemp % (slash+1));
299+
ERROR_MSG(fmt::format("EndPoint::findIndicatedInterface: "
300+
"netmask match {} length {} is not valid.\n", iftemp, (slash+1)));
301301
return -1;
302302
}
303303
}
@@ -313,8 +313,8 @@ int EndPoint::findIndicatedInterface(const char * spec, char * name)
313313
}
314314
else
315315
{
316-
ERROR_MSG(boost::format("EndPoint::findIndicatedInterface: "
317-
"No interface matching interface spec '%1%' found\n") % spec);
316+
ERROR_MSG(fmt::format("EndPoint::findIndicatedInterface: "
317+
"No interface matching interface spec '{}' found\n", spec));
318318
return -1;
319319
}
320320

@@ -364,10 +364,10 @@ int EndPoint::findIndicatedInterface(const char * spec, char * name)
364364
if (name[0] == 0)
365365
{
366366
uint8 * qik = (uint8*)&addr;
367-
ERROR_MSG(boost::format("EndPoint::findIndicatedInterface: "
368-
"No interface matching netmask spec '%1%' found "
369-
"(evals to %2%.%3%.%4%.%5%/%6%)\n") % spec %
370-
qik[0] % qik[1] % qik[2] % qik[3] % netmaskbits);
367+
ERROR_MSG(fmt::format("EndPoint::findIndicatedInterface: "
368+
"No interface matching netmask spec '{}' found "
369+
"(evals to {}.{}.{}.{}/{})\n", spec,
370+
qik[0], qik[1], qik[2], qik[3], netmaskbits));
371371

372372
return -2; // parsing ok, just didn't match
373373
}
@@ -415,10 +415,10 @@ int EndPoint::getBufferSize(int optname) const
415415
if (rberr == 0 && rbargsize == sizeof(int))
416416
return recvbuf;
417417

418-
ERROR_MSG(boost::format("EndPoint::getBufferSize: "
419-
"Failed to read option %1%: %2%\n") %
420-
(optname == SO_SNDBUF ? "SO_SNDBUF" : "SO_RCVBUF") %
421-
kbe_strerror());
418+
ERROR_MSG(fmt::format("EndPoint::getBufferSize: "
419+
"Failed to read option {}: {}\n",
420+
(optname == SO_SNDBUF ? "SO_SNDBUF" : "SO_RCVBUF"),
421+
kbe_strerror()));
422422

423423
return -1;
424424
}
@@ -446,8 +446,8 @@ bool EndPoint::recvAll(void * gramData, int gramSize)
446446
}
447447
else
448448
{
449-
WARNING_MSG(boost::format("EndPoint::recvAll: Got error '%1%'\n") %
450-
kbe_strerror());
449+
WARNING_MSG(fmt::format("EndPoint::recvAll: Got error '{}'\n",
450+
kbe_strerror()));
451451
}
452452

453453
return false;

‎kbe/src/lib/network/error_reporter.cpp‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ void ErrorReporter::addReport(const Address & address, const std::string & error
216216

217217
if (millisSinceLastReport >= ERROR_REPORT_MIN_PERIOD_MS)
218218
{
219-
ERROR_MSG(boost::format("%1%\n") %
219+
ERROR_MSG(fmt::format("{}\n",
220220
addressErrorToString(address, errorString,
221-
reportAndCount, now).c_str());
221+
reportAndCount, now).c_str()));
222222

223223
reportAndCount.count = 0;
224224
reportAndCount.lastReportStamps = now;
@@ -227,8 +227,8 @@ void ErrorReporter::addReport(const Address & address, const std::string & error
227227
}
228228
else
229229
{
230-
ERROR_MSG(boost::format("%1%\n") %
231-
addressErrorToString(address, errorString).c_str());
230+
ERROR_MSG(fmt::format("{}\n",
231+
addressErrorToString(address, errorString).c_str()));
232232

233233
ErrorReportAndCount reportAndCount = {
234234
now, // lastReportStamps,
@@ -276,11 +276,11 @@ void ErrorReporter::reportPendingExceptions(bool reportBelowThreshold)
276276
{
277277
if (reportAndCount.count)
278278
{
279-
ERROR_MSG(boost::format("%1%\n") %
279+
ERROR_MSG(fmt::format("{}\n",
280280
addressErrorToString(
281281
addressError.first, addressError.second,
282282
reportAndCount, now).c_str()
283-
);
283+
));
284284
reportAndCount.count = 0;
285285
reportAndCount.lastReportStamps = now;
286286

‎kbe/src/server/cellapp/entity_coordinate_node.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ watcherNodes_()
3333
flags(COORDINATE_NODE_FLAG_ENTITY);
3434

3535
#ifdef _DEBUG
36-
descr_ = (boost::format("EntityCoordinateNode(%1%_%2%)") % pEntity->scriptName() % pEntity->id()).str();
36+
descr_ = (fmt::format("EntityCoordinateNode({}_{})", pEntity->scriptName(), pEntity->id()));
3737
#endif
3838
}
3939

‎kbe/src/server/cellapp/entity_interface_macros.hpp‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ namespace KBEngine{
6060
} \
6161
else \
6262
{ \
63-
ERROR_MSG(boost::format( \
64-
"Messagehandler::handle: can't found entityID:%1%.\n") % \
65-
eid); \
63+
ERROR_MSG(fmt::format( \
64+
"Messagehandler::handle: can't found entityID:{}.\n", \
65+
eid)); \
6666
} \
6767
} \
6868
Mercury::MERCURY_MESSAGE_TYPE NAME##EntityMessagehandler_stream::type()const\
@@ -125,9 +125,9 @@ namespace KBEngine{
125125
} \
126126
else \
127127
{ \
128-
ERROR_MSG(boost::format( \
129-
"Messagehandler::handle: can't found entityID:%1%.\n") % \
130-
eid); \
128+
ERROR_MSG(fmt::format( \
129+
"Messagehandler::handle: can't found entityID:{}.\n", \
130+
eid)); \
131131
} \
132132
} \
133133
Mercury::MERCURY_MESSAGE_TYPE NAME##EntityMessagehandler1::type()const \
@@ -193,9 +193,9 @@ namespace KBEngine{
193193
} \
194194
else \
195195
{ \
196-
ERROR_MSG(boost::format( \
197-
"Messagehandler::handle: can't found entityID:%1%.\n") % \
198-
eid); \
196+
ERROR_MSG(fmt::format( \
197+
"Messagehandler::handle: can't found entityID:{}.\n", \
198+
eid)); \
199199
} \
200200
} \
201201
Mercury::MERCURY_MESSAGE_TYPE NAME##EntityMessagehandler2::type()const\
@@ -262,9 +262,9 @@ namespace KBEngine{
262262
} \
263263
else \
264264
{ \
265-
ERROR_MSG(boost::format( \
266-
"Messagehandler::handle: can't found entityID:%1%.\n") % \
267-
eid); \
265+
ERROR_MSG(fmt::format( \
266+
"Messagehandler::handle: can't found entityID:{}.\n", \
267+
eid)); \
268268
} \
269269
} \
270270
Mercury::MERCURY_MESSAGE_TYPE NAME##EntityMessagehandler0::type()const \
@@ -334,9 +334,9 @@ namespace KBEngine{
334334
} \
335335
else \
336336
{ \
337-
ERROR_MSG(boost::format( \
338-
"Messagehandler::handle: can't found entityID:%1%.\n") % \
339-
eid); \
337+
ERROR_MSG(fmt::format( \
338+
"Messagehandler::handle: can't found entityID:{}.\n", \
339+
eid)); \
340340
} \
341341
} \
342342
Mercury::MERCURY_MESSAGE_TYPE NAME##EntityMessagehandler3::type()const \

0 commit comments

Comments
 (0)