From: g0dil Date: Mon, 2 Mar 2009 08:55:46 +0000 (+0000) Subject: Utils/Termlib: Add some logging X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=8d0f36a502bf65b88b5225ffaba25e5d4488df4d;p=senf.git Utils/Termlib: Add some logging git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1136 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Utils/Termlib/TelnetTerminal.cc b/Utils/Termlib/TelnetTerminal.cc index 5e08938..2699f9c 100644 --- a/Utils/Termlib/TelnetTerminal.cc +++ b/Utils/Termlib/TelnetTerminal.cc @@ -67,6 +67,8 @@ prefix_ void senf::term::TelnetTerminal::write(char ch) prefix_ void senf::term::TelnetTerminal::v_setupComplete() { + bool init (true); + if (setupFailed_) v_setupFailed(); else if (! (width() > 0 @@ -74,7 +76,23 @@ prefix_ void senf::term::TelnetTerminal::v_setupComplete() && localOption(telnetopt::SUPPRESS_GO_AHEAD) && peerOption(telnetopt::SUPPRESS_GO_AHEAD) && localOption(telnetopt::ECHO) - && callbacks_->cb_init())) { + && (init = callbacks_->cb_init()))) { + + SENF_LOG_BLOCK((senf::log::NOTICE)({ + log << "TelnetTerminal setup failed:\n"; + if (width() <= 0) + log << " missing telnet client NAWS support\n"; + if (terminalType().empty()) + log << " missing telnet client TERMINAL_TYPE support\n"; + if (! localOption(telnetopt::SUPPRESS_GO_AHEAD) || + ! peerOption(telnetopt::SUPPRESS_GO_AHEAD)) + log << " missing telnet clinet SGO support\n"; + if (! localOption(telnetopt::ECHO)) + log << " missing telnet client ECHO support\n"; + if (! init) + log << " terminal initialization (cb_init) failed\n"; + })); + setupFailed_ = true; requestPeerOption(telnetopt::SUPPRESS_GO_AHEAD, false); requestLocalOption(telnetopt::SUPPRESS_GO_AHEAD, false); @@ -84,6 +102,10 @@ prefix_ void senf::term::TelnetTerminal::v_setupComplete() if (! requestsPending()) v_setupFailed(); } + else + SENF_LOG((senf::log::NOTICE)( + "Initialized TelnetTerminal: TERM=" << terminalType() + << ", size=" << width() << "x" << height())); } prefix_ void senf::term::TelnetTerminal::v_charReceived(char ch) diff --git a/Utils/Termlib/TelnetTerminal.hh b/Utils/Termlib/TelnetTerminal.hh index 8d31583..650ce1f 100644 --- a/Utils/Termlib/TelnetTerminal.hh +++ b/Utils/Termlib/TelnetTerminal.hh @@ -29,6 +29,7 @@ // Custom includes #include "Telnet.hh" #include "AbstractTerminal.hh" +#include "../Logger.hh" //#include "TelnetTerminal.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -53,6 +54,7 @@ namespace term { public telnethandler::NAWS, public AbstractTerminal { + SENF_LOG_CLASS_AREA(); public: TelnetTerminal();