Syslogd.cpp

Go to the documentation of this file.
00001 /*
00002 
00003 $Header$
00004 
00005 */
00006 
00007 #include "Error.h"
00008 #include "Syslog.h"
00009 
00010 #include "Syslogd.h"
00011 
00012 // Protected methods.
00013 
00014 Syslogd::Syslogd(const ValueList &params) : Service<Syslogd>(params)
00015 {
00016   int res;
00017 
00018   if (FAILED(res = CONNECT(ERR(), debug, this, Syslogd, logDebug))) {
00019     failure(ERROR_BACKTRACE(res));
00020     return;
00021   }
00022   if (FAILED(res = CONNECT(ERR(), error, this, Syslogd, logError))) {
00023     failure(ERROR_BACKTRACE(res));
00024     return;
00025   }
00026   if (FAILED(res = CONNECT(ERR(), warning, this, Syslogd, logWarning))) {
00027     failure(ERROR_BACKTRACE(res));
00028     return;
00029   }
00030 }
00031 
00032 Syslogd::~Syslogd()
00033 {
00034 }
00035 
00036 // Private methods.
00037 
00038 int Syslogd::logDebug(const String &timestamp, const String &fileName,
00039                      const unsigned int lineNum, const String &functionName, const String &msg)
00040 {
00041   SYSLOG()->log(SEVERITY_DEBUG, timestamp, fileName, lineNum, functionName, Syslog::severityName(SEVERITY_DEBUG).toUpper() + ": " + msg);
00042   return OK;
00043 }
00044 
00045 int Syslogd::logError(const String &timestamp, const String &fileName,
00046                      const unsigned int lineNum, const String &functionName, const String &msg)
00047 {
00048   SYSLOG()->log(SEVERITY_ERROR, timestamp, fileName, lineNum, functionName, Syslog::severityName(SEVERITY_ERROR).toUpper() + ": " + msg);
00049   return OK;
00050 }
00051 
00052 int Syslogd::logWarning(const String &timestamp, const String &fileName,
00053                        const unsigned int lineNum, const String &functionName, const String &msg)
00054 {
00055   SYSLOG()->log(SEVERITY_WARNING, timestamp, fileName, lineNum, functionName, Syslog::severityName(SEVERITY_WARNING).toUpper() + ": " + msg);
00056   return OK;
00057 }
00058 
00059 int Syslogd::logInfo(const String &timestamp, const String &fileName,
00060                     const unsigned int lineNum, const String &functionName, const String &msg)
00061 {
00062   SYSLOG()->log(SEVERITY_INFO, timestamp, fileName, lineNum, functionName, Syslog::severityName(SEVERITY_INFO).toUpper() + ": " + msg);
00063   return OK;
00064 }

Generated on Thu Sep 6 20:11:25 2007 for Pylon Application Platform by  doxygen 1.5.1