From 611e311124523cb8add6960e894d92b5d909d2ad Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 3 Aug 2008 18:15:41 +0000 Subject: dump console content on server shutdown --- src/server/console.cc | 13 +++++++++++++ src/server/console.h | 2 ++ 2 files changed, 15 insertions(+) (limited to 'src/server') diff --git a/src/server/console.cc b/src/server/console.cc index 1fb7f38..c4e63e3 100644 --- a/src/server/console.cc +++ b/src/server/console.cc @@ -82,10 +82,23 @@ void Console::shutdown() server_console.draw(); endwin(); console_initialized = false; + + server_console.dump(); #endif } #ifdef HAVE_CURSES +void Console::dump() +{ + flush(); + + // dump console content + for (std::deque::iterator it = consoleinterface_text.begin(); it != consoleinterface_text.end(); it++) { + print_ansi((*it).c_str()); + std::cout << std::endl; + } +} + void Console::resize() { if (!console_initialized) diff --git a/src/server/console.h b/src/server/console.h index ed15c79..b96f593 100644 --- a/src/server/console.h +++ b/src/server/console.h @@ -34,6 +34,8 @@ protected: void draw_text(); /// draw the console input (ncurses) void draw_input(); + /// dump console content to cout + void dump(); private: /// set ncurses drawing color -- cgit v1.2.3