MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / loggingCallback

Method loggingCallback

src/bzflag/ControlPanel.cpp:364–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362
363
364void ControlPanel::loggingCallback(int level,
365 const std::string& rawMsg, void* data) {
366// -- always store the debug messages
367// if (level > debugLevel) {
368// return;
369// }
370 std::string msg = rawMsg;
371 while (!msg.empty() && (msg[msg.size() - 1] == '\n')) {
372 msg.resize(msg.size() - 1);
373 }
374 std::string color = "";
375 if (level >= 0) {
376 switch (level) {
377 case 1: { color = ANSI_STR_FG_GREEN; break; }
378 case 2: { color = ANSI_STR_FG_CYAN; break; }
379 case 3: { color = ANSI_STR_FG_BLUE; break; }
380 case 4: { color = ANSI_STR_FG_YELLOW; break; }
381 case 5: { color = ANSI_STR_FG_ORANGE; break; }
382 case 6: { color = ANSI_STR_FG_RED; break; }
383 case 7: { color = ANSI_STR_FG_MAGENTA; break; }
384 case 8: { color = ANSI_STR_FG_WHITE; break; }
385 case 9: { color = ANSI_STR_FG_BLACK; break; }
386 default: { color = ANSI_STR_UNDERLINE; break; }
387 }
388 }
389 ((ControlPanel*)data)->addMessage(color + msg, ControlPanel::MessageDebug);
390}
391
392
393void ControlPanel::bzdbCallback(const std::string& /*name*/, void* data) {

Callers

nothing calls this directly

Calls 4

addMessageMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected