--- openmosixview-1.5.orig/openmosixcollector/main.cpp +++ openmosixview-1.5/openmosixcollector/main.cpp @@ -19,6 +19,7 @@ #include #endif +#include #include "openmosixcollector.h" @@ -76,7 +77,7 @@ while (1) { if(!collector->checknodes()) { collector->updatenodelist(); - cout << "updating nodelist" << endl; + syslog(LOG_INFO, "updating nodelist"); } collector->lognodes(); tsecs = collector->incrementcounter(); --- openmosixview-1.5.orig/openmosixcollector/openmosixcollector.cpp +++ openmosixview-1.5/openmosixcollector/openmosixcollector.cpp @@ -15,6 +15,8 @@ * * ***************************************************************************/ +#include + #include "openmosixcollector.h" openmosixcollector::openmosixcollector(){ @@ -204,6 +206,7 @@ } exit(0); } + openlog("openmosixcollector",LOG_PID,LOG_USER); return 1; } } @@ -418,7 +421,8 @@ nodelogfile << "\n"; nodelogfile.close(); } else { - cout << "could not write to " << nodelogfile_txt << endl; + syslog(LOG_ERR, "could not write to %s", + nodelogfile_txt.c_str()); } } else { @@ -467,11 +471,11 @@ synclogfile << "\n"; synclogfile.close(); } else { - cout << "could not write to " << nodelogfile_txt << endl; + syslog(LOG_ERR, "could not write to %s", + nodelogfile_txt.c_str()); } } // end of for - cout << "synced the file " << nodelogfile_txt << endl; - + syslog(LOG_DEBUG, "synced the file %s", nodelogfile_txt.c_str()); } // end of sync check @@ -526,7 +530,8 @@ clusterlogfile << "\n"; clusterlogfile.close(); } else { - cout << "could not write to " << clusterlogfile_txt << endl; + syslog(LOG_ERR, "could not write to %s", + clusterlogfile_txt.c_str()); } } @@ -554,7 +559,8 @@ return cread; } } else { - cout << "could not read from " << clusterdirectory << what << tmpstr << endl; + syslog(LOG_ERR, "could not read from %s%s%s", + clusterdirectory, what.c_str(), tmpstr.c_str()); return "0"; } } @@ -696,7 +702,7 @@ processlogfile << "\n"; processlogfile.close(); } else { - cout << "could not write to " << processlogfile_txt << endl; + syslog(LOG_ERR, "could not write to %s", processlogfile_txt.c_str()); } } } @@ -840,7 +846,7 @@ writeval.close(); return countit; } else { - cout << "could not write to " << tmpstr << endl; + syslog(LOG_ERR, "could not write to %s", tmpstr.c_str()); return 0; } }