From 3983be135c14d355c36ee3d69424f03c73fc6a13 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 24 Jan 2014 14:24:40 +0100 Subject: Add logging support to RemoteControlTelnet --- src/RemoteControl.cpp | 10 +++++----- src/RemoteControl.h | 3 --- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/RemoteControl.cpp b/src/RemoteControl.cpp index 876d71a..7cc975a 100644 --- a/src/RemoteControl.cpp +++ b/src/RemoteControl.cpp @@ -23,9 +23,9 @@ */ #include #include -#include #include #include +#include "Log.h" #include "RemoteControl.h" @@ -71,7 +71,7 @@ RemoteControllerTelnet::process(long) std::getline(str, in_message); if (length == 0) { - std::cerr << "Connection terminated" << std::endl; + etiLog.level(info) << "RC: Connection terminated"; break; } @@ -85,17 +85,17 @@ RemoteControllerTelnet::process(long) continue; } - std::cerr << "Got message '" << in_message << "'" << std::endl; + etiLog.level(info) << "RC: Got message '" << in_message << "'"; dispatch_command(socket, in_message); } - std::cerr << "Closing socket" << std::endl; + etiLog.level(info) << "RC: Closing socket"; socket.close(); } } catch (std::exception& e) { - std::cerr << e.what() << std::endl; + etiLog.level(error) << "Remote control caught exception: " << e.what(); } } diff --git a/src/RemoteControl.h b/src/RemoteControl.h index 7dcda0a..d0965e0 100644 --- a/src/RemoteControl.h +++ b/src/RemoteControl.h @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -93,7 +92,6 @@ class RemoteControllable { /* Return a list of possible parameters that can be set */ virtual list get_supported_parameters() { - cerr << "get_sup_par" << m_parameters.size() << endl; list parameterlist; for (list< vector >::iterator it = m_parameters.begin(); it != m_parameters.end(); ++it) { @@ -191,7 +189,6 @@ class RemoteControllerTelnet : public BaseRemoteController { list< vector > allparams; list params = controllable->get_supported_parameters(); - cerr << "# of supported parameters " << params.size() << endl; for (list::iterator it = params.begin(); it != params.end(); ++it) { vector item; item.push_back(*it); -- cgit v1.2.3