--- smsdaemon/common.cpp 2008/12/07 21:42:15 150 +++ smsdaemon/common.cpp 2008/12/08 21:28:40 157 @@ -7,7 +7,6 @@ #include #include #include -#include #include #include @@ -16,7 +15,6 @@ #include "ConfigFile.h" using namespace std; -const char* Months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov","Dec"}; Common* Common::instance() { @@ -61,37 +59,6 @@ return _configFile; } -void Common::logMessage(string msg) -{ - time_t t = time(0); - tm now; - localtime_r(&t, &now); - - ostringstream out; - out << Months[ now.tm_mon ] << " " << setw(2) << setfill('0') << now.tm_mday; - out << " " << setw(2) << setfill('0') << now.tm_hour; - out << ":" << setw(2) << setfill('0') << now.tm_min; - out << ":" << setw(2) << setfill('0') << now.tm_sec; - out << " " << msg << endl; - - if (this->isDaemon && _logFile != "" && daemonized) - { - seteuid(0); - ofstream of( _logFile.c_str(), ios_base::out | ios_base::app | ios_base::ate);//append mode - if (of) - { - of << out.str(); - of.flush(); - of.close(); - } - seteuid( this->uid); - } - else - { - cout << out.str(); - cout.flush(); - } -} void Common::printUsage() {