diff options
author | ShadowNinja <shadowninja@minetest.net> | 2015-07-05 00:53:38 +0200 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2015-07-05 01:05:24 +0200 |
commit | a93838707a9aab104c20b6a971d8c622184a508f (patch) | |
tree | 96a0d445f6ef2c38addd9bfc186345327894ccc6 | |
parent | d786a272c0a400f9aa2c89d696aa6f9840f83d03 (diff) | |
download | minetest-a93838707a9aab104c20b6a971d8c622184a508f.tar.gz minetest-a93838707a9aab104c20b6a971d8c622184a508f.tar.bz2 minetest-a93838707a9aab104c20b6a971d8c622184a508f.zip |
Use minetest logging facilities for irrlicht log output
-rw-r--r-- | src/client/inputhandler.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/client/inputhandler.h b/src/client/inputhandler.h index 7cd3ddc71..3da856f7b 100644 --- a/src/client/inputhandler.h +++ b/src/client/inputhandler.h @@ -85,10 +85,18 @@ public: 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 + }; + 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 */ |