1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Refactor logging

- Add warning log level
- Change debug_log_level setting to enumeration string
- Map Irrlicht log events to MT log events
- Encapsulate log_* functions and global variables into a class, Logger
- Unify dstream with standard logging mechanism
- Unify core.debug() with standard core.log() script API
This commit is contained in:
ShadowNinja 2015-10-13 03:57:44 -04:00 committed by kwolekr
parent e0b57c1140
commit 2139d7d45f
25 changed files with 599 additions and 652 deletions

View file

@ -40,7 +40,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "guiPasswordChange.h"
#include "guiVolumeChange.h"
#include "hud.h"
#include "logoutputbuffer.h"
#include "mainmenumanager.h"
#include "mapblock.h"
#include "nodedef.h" // Needed for determining pointing to nodes
@ -1163,7 +1162,7 @@ static void updateChat(Client &client, f32 dtime, bool show_debug,
ChatBackend &chat_backend, gui::IGUIStaticText *guitext_chat)
{
// Add chat log output for errors to be shown in chat
static LogOutputBuffer chat_log_error_buf(LMT_ERROR);
static LogOutputBuffer chat_log_error_buf(g_logger, LL_ERROR);
// Get new messages from error log buffer
while (!chat_log_error_buf.empty()) {
@ -2675,7 +2674,7 @@ void Game::processKeyboardInput(VolatileRunFlags *flags,
// Print debug stacks
dstream << "-----------------------------------------"
<< std::endl;
dstream << DTIME << "Printing debug stacks:" << std::endl;
dstream << "Printing debug stacks:" << std::endl;
dstream << "-----------------------------------------"
<< std::endl;
debug_stacks_print();