Skip to content
Snippets Groups Projects
Commit 191612f2 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 b413145c
Branches
Tags
No related merge requests found
......@@ -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:
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment