From 45ec1d9b8c5ce8ae43b46dc24d6c15b374e4795f Mon Sep 17 00:00:00 2001
From: Steven Murray <Steven.Murray@cern.ch>
Date: Thu, 1 Jun 2017 09:58:59 +0200
Subject: [PATCH] cta/CTA#106 cta-taped logging a timestamp

As agreed by Eric and Steve, the "<priority | LOG_LOCAL3>" prefix
of non-syslog error messages has been dropped.
---
 common/log/Logger.cpp | 5 +----
 common/log/Logger.hpp | 2 --
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/common/log/Logger.cpp b/common/log/Logger.cpp
index 02d1513085..98d571751b 100644
--- a/common/log/Logger.cpp
+++ b/common/log/Logger.cpp
@@ -78,7 +78,7 @@ void Logger::operator() (
   // Safe to get a reference to the textual representation of the priority
   const std::string &priorityText = priorityTextPair->second;
 
-  const std::string header = createMsgHeader(priority | LOG_LOCAL3, timeStamp, m_programName, pid);
+  const std::string header = createMsgHeader(timeStamp, m_programName, pid);
   const std::string body = createMsgBody(priority, priorityText, msg, params, rawParams, m_programName, pid);
 
   writeMsgToUnderlyingLoggingSystem(header, body);
@@ -227,7 +227,6 @@ void Logger::setLogMask(const int logMask) {
 // createMsgHeader
 //-----------------------------------------------------------------------------
 std::string Logger::createMsgHeader(
-  const int priority,
   const struct timeval &timeStamp,
   const std::string &programName,
   const int pid) {
@@ -236,8 +235,6 @@ std::string Logger::createMsgHeader(
   int bufLen = sizeof(buf);
   int len = 0;
 
-  os << "<" << priority << ">";
-
   struct tm localTime;
   localtime_r(&(timeStamp.tv_sec), &localTime);
   len += strftime(buf, bufLen, "%Y-%m-%dT%T", &localTime);
diff --git a/common/log/Logger.hpp b/common/log/Logger.hpp
index dccc5311ff..0eff66574e 100644
--- a/common/log/Logger.hpp
+++ b/common/log/Logger.hpp
@@ -246,14 +246,12 @@ private:
    * relies on rsyslog to provide message headers and therefore does not call
    * this method.
    *
-   * @param priority The priority of the message.
    * @param timeStamp The time stamp of the message.
    * @param programName the program name of the log message.
    * @param pid The process ID of the process logging the message.
    * @return The message header.
    */
   static std::string createMsgHeader(
-    const int priority,
     const struct timeval &timeStamp,
     const std::string &programName,
     const int pid);
-- 
GitLab