Commit 17500645 authored by Steven Murray's avatar Steven Murray
Browse files

Added the following write call to the API of the CASTOR logging system, the

idea being you might simply want to log a message with no parameters.

  /**
   * Writes a message into the CASTOR logging system. Note that no exception
   * will ever be thrown in case of failure. Failures will actually be
   * silently ignored in order to not impact the processing.
   *
   * Note that this version of writeMsg() implicitly uses the current time as
   * the time stamp of the message.
   *
   * @param priority the priority of the message as defined by the syslog API.
   * @param msg the message.
   */
  virtual void writeMsg(
    const int priority,
    const std::string &msg) throw() = 0;
parent ff4637e9
......@@ -128,6 +128,21 @@ public:
castor::log::Param(&params)[numParams]) throw() {
writeMsg(priority, msg, numParams, params);
}
/**
* Writes a message into the CASTOR logging system. Note that no exception
* will ever be thrown in case of failure. Failures will actually be
* silently ignored in order to not impact the processing.
*
* Note that this version of writeMsg() implicitly uses the current time as
* the time stamp of the message.
*
* @param priority the priority of the message as defined by the syslog API.
* @param msg the message.
*/
virtual void writeMsg(
const int priority,
const std::string &msg) throw() = 0;
}; // class Log
} // namespace log
......
......@@ -484,7 +484,7 @@ void castor::log::LogImplementation::reducedSyslog(const char *const msg,
// writeMsg
//-----------------------------------------------------------------------------
void castor::log::LogImplementation::writeMsg(
const int severity,
const int priority,
const std::string &msg,
const int numParams,
const castor::log::Param params[]) throw() {
......@@ -492,5 +492,15 @@ void castor::log::LogImplementation::writeMsg(
struct timeval timeStamp;
gettimeofday(&timeStamp, NULL);
writeMsg(severity, msg, numParams, params, timeStamp);
writeMsg(priority, msg, numParams, params, timeStamp);
}
//-----------------------------------------------------------------------------
// writeMsg
//-----------------------------------------------------------------------------
void castor::log::LogImplementation::writeMsg(
const int priority,
const std::string &msg) throw() {
Param *emptyParams = NULL;
writeMsg(priority, msg, 0, emptyParams);
}
......@@ -96,6 +96,21 @@ public:
const int numParams,
const castor::log::Param params[]) throw();
/**
* Writes a message into the CASTOR logging system. Note that no exception
* will ever be thrown in case of failure. Failures will actually be
* silently ignored in order to not impact the processing.
*
* Note that this version of writeMsg() implicitly uses the current time as
* the time stamp of the message.
*
* @param priority the priority of the message as defined by the syslog API.
* @param msg the message.
*/
void writeMsg(
const int priority,
const std::string &msg) throw();
private:
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment