diff options
author | deva <deva> | 2006-01-10 11:18:50 +0000 |
---|---|---|
committer | deva <deva> | 2006-01-10 11:18:50 +0000 |
commit | cbe575f21ab008182b5771b691ec4c93c5b2b87a (patch) | |
tree | eda4f44e4a10d179c06bcf89be95052038c7503b /src/cprlisten.cc | |
parent | 6568c8ec81fac9bee7ceceaee0de7455ac006160 (diff) |
*** empty log message ***
Diffstat (limited to 'src/cprlisten.cc')
-rw-r--r-- | src/cprlisten.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/cprlisten.cc b/src/cprlisten.cc index 9ecac86..62deede 100644 --- a/src/cprlisten.cc +++ b/src/cprlisten.cc @@ -34,8 +34,9 @@ using namespace std; #define MAGIC_STOP_STRING "SHUTTHEFUCKUP" -CPRListen::CPRListen(unsigned short port) +CPRListen::CPRListen(Info *info, unsigned short port) { + this->info = info; this->port = port; cpr = "N/A"; cprchanged = false; @@ -54,12 +55,13 @@ void CPRListen::stop() socket.connect("localhost", port); socket.send_string(MAGIC_STOP_STRING); } catch(Network_error &e) { - cerr << "In stop(): " << e.error << endl; + info.error("In stop(): %s.", e.error.c_str()); } } void CPRListen::thread_main() { + info.info("Listening for CPRs."); while(running) { try { string newcpr; @@ -74,15 +76,15 @@ void CPRListen::thread_main() cprchanged = true; cpr = newcpr; mutex.unlock(); - // cerr << "Got CPR: " << cpr << endl; + info.info("Got CPR: %s.", cpr.c_str()); } } catch(Network_error &e) { - cerr << "In thread_main(): " << e.error << endl; + info.error("In thread_main(): %s.", e.error.c_str()); running = false; } } - // cout << "fisk!" << endl; + info.info("Stopped listening for CPRs."); } bool CPRListen::cprChanged() |