Skip to content

Commit a938387

Browse files
ShadowNinjaest31
authored andcommittedJul 4, 2015
Use minetest logging facilities for irrlicht log output
1 parent d786a27 commit a938387

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed
 

Diff for: ‎src/client/inputhandler.h

+12-4
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,18 @@ class MyEventReceiver : public IEventReceiver
8585
mouse_wheel += event.MouseInput.Wheel;
8686
}
8787
}
88-
}
89-
if (event.EventType == irr::EET_LOG_TEXT_EVENT) {
90-
dstream << std::string("Irrlicht log: ") + std::string(event.LogEvent.Text)
91-
<< std::endl;
88+
} else if (event.EventType == irr::EET_LOG_TEXT_EVENT) {
89+
static const enum LogMessageLevel irr_loglev_conv[] = {
90+
LMT_VERBOSE, // ELL_DEBUG
91+
LMT_INFO, // ELL_INFORMATION
92+
LMT_ACTION, // ELL_WARNING
93+
LMT_ERROR, // ELL_ERROR
94+
LMT_ERROR, // ELL_NONE
Has conversations. Original line has conversations.
95+
};
96+
assert(event.LogEvent.Level < sizeof(irr_loglev_conv));
97+
log_printline(irr_loglev_conv[event.LogEvent.Level],
98+
std::string("Irrlicht: ")
99+
+ (const char*) event.LogEvent.Text);
92100
return true;
93101
}
94102
/* always return false in order to continue processing events */

0 commit comments

Comments
 (0)
Please sign in to comment.