diff options
| author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-01-24 14:24:40 +0100 | 
|---|---|---|
| committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-01-24 14:24:40 +0100 | 
| commit | 3983be135c14d355c36ee3d69424f03c73fc6a13 (patch) | |
| tree | d5de4d7e796cb21802b6a9c2197de433d7f8674d /src | |
| parent | f75ac25e6e93ab167b5f3cfdecbbbf286fdc4fed (diff) | |
| download | dabmux-3983be135c14d355c36ee3d69424f03c73fc6a13.tar.gz dabmux-3983be135c14d355c36ee3d69424f03c73fc6a13.tar.bz2 dabmux-3983be135c14d355c36ee3d69424f03c73fc6a13.zip  | |
Add logging support to RemoteControlTelnet
Diffstat (limited to 'src')
| -rw-r--r-- | src/RemoteControl.cpp | 10 | ||||
| -rw-r--r-- | 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 <list>  #include <string> -#include <iostream>  #include <string>  #include <boost/asio.hpp> +#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 <list>  #include <map>  #include <string> -#include <iostream>  #include <string>  #include <boost/bind.hpp>  #include <boost/shared_ptr.hpp> @@ -93,7 +92,6 @@ class RemoteControllable {          /* Return a list of possible parameters that can be set */          virtual list<string> get_supported_parameters() { -            cerr << "get_sup_par" << m_parameters.size() << endl;              list<string> parameterlist;              for (list< vector<string> >::iterator it = m_parameters.begin();                      it != m_parameters.end(); ++it) { @@ -191,7 +189,6 @@ class RemoteControllerTelnet : public BaseRemoteController {              list< vector<string> > allparams;              list<string> params = controllable->get_supported_parameters(); -            cerr << "# of supported parameters " << params.size() << endl;              for (list<string>::iterator it = params.begin(); it != params.end(); ++it) {                  vector<string> item;                  item.push_back(*it);  | 
