Skip to content

Commit

Permalink
Use minetest logging facilities for irrlicht log output
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowNinja authored and est31 committed Jul 4, 2015
1 parent d786a27 commit a938387
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/client/inputhandler.h
Expand Up @@ -85,10 +85,18 @@ class MyEventReceiver : public IEventReceiver
mouse_wheel += event.MouseInput.Wheel;
}
}
}
if (event.EventType == irr::EET_LOG_TEXT_EVENT) {
dstream << std::string("Irrlicht log: ") + std::string(event.LogEvent.Text)
<< std::endl;
} else if (event.EventType == irr::EET_LOG_TEXT_EVENT) {
static const enum LogMessageLevel irr_loglev_conv[] = {
LMT_VERBOSE, // ELL_DEBUG
LMT_INFO, // ELL_INFORMATION
LMT_ACTION, // ELL_WARNING
LMT_ERROR, // ELL_ERROR
LMT_ERROR, // ELL_NONE

This comment has been minimized.

Copy link
@Iniquitatis

Iniquitatis Jul 5, 2015

Copy-paste typo?

This comment has been minimized.

Copy link
@est31

est31 Jul 5, 2015

Contributor

No, we have no NONE logging level. NONE means displayed always, thats closest to errorstream. We will get one though, with @ShadowNinja 's changes.

};
assert(event.LogEvent.Level < sizeof(irr_loglev_conv));
log_printline(irr_loglev_conv[event.LogEvent.Level],
std::string("Irrlicht: ")
+ (const char*) event.LogEvent.Text);
return true;
}
/* always return false in order to continue processing events */
Expand Down

0 comments on commit a938387

Please sign in to comment.