Browse Source

HPCC-21440 Remove audiences and message classes that will no longer be used

Signed-off-by: Shamser Ahmed <shamser.ahmed@lexisnexis.co.uk>
Shamser Ahmed 6 years ago
parent
commit
59d8b3fc48

+ 1 - 1
ecl/eclagent/eclagent.cpp

@@ -3257,7 +3257,7 @@ void printStart(int argc, const char *argv[])
 
 bool ControlHandler()
 {
-    LOG(MCevent,"ControlHandler Stop signalled");
+    LOG(MCoperatorInfo,"ControlHandler Stop signalled");
     return true;
 }
 

+ 1 - 1
esp/services/common/wsexcept.cpp

@@ -154,7 +154,7 @@ public:
     virtual MessageAudience errorAudience() const
     {
         synchronized block(mutex);
-        return ordinality() == 1 ? item(0).errorAudience() : MSGAUD_unknown;
+        return ordinality() == 1 ? item(0).errorAudience() : MSGAUD_programmer;
     }
     virtual WsErrorType errorType() const
     {

+ 1 - 1
roxie/ccd/ccdcontext.cpp

@@ -1071,7 +1071,7 @@ public:
             E->errorMessage(text);
             int errCode = E->errorCode();
             E->Release();
-            IException *ee = MakeStringException(MSGAUD_internal, errCode, "%s", text.str());
+            IException *ee = MakeStringException(MSGAUD_programmer, errCode, "%s", text.str());
             logctx.logOperatorException(ee, __FILE__, __LINE__, "Exception caught in RawDataReader::nextBlock");
             throw ee;
         }

+ 1 - 1
roxie/ccd/ccdfile.cpp

@@ -62,7 +62,7 @@ public:
     IMPLEMENT_IINTERFACE;
     virtual int             errorCode() const { return 0; }
     virtual StringBuffer &  errorMessage(StringBuffer &msg) const { return msg.append("not yet open"); }
-    virtual MessageAudience errorAudience() const { return MSGAUD_internal; }
+    virtual MessageAudience errorAudience() const { return MSGAUD_programmer; }
 };
 
 class CFailingFileIO : implements IFileIO, public CInterface

+ 1 - 1
roxie/ccd/ccdserver.cpp

@@ -2112,7 +2112,7 @@ public:
     IMPLEMENT_IINTERFACE;
     virtual int             errorCode() const { return code; }
     virtual StringBuffer &  errorMessage(StringBuffer &msg) const { return msg.append("LimitSkipException"); }
-    virtual MessageAudience errorAudience() const { return MSGAUD_internal; }
+    virtual MessageAudience errorAudience() const { return MSGAUD_programmer; }
 };
 
 IException *makeLimitSkipException(bool isKeyed)

+ 2 - 12
system/jlib/jexcept.cpp

@@ -289,12 +289,8 @@ const char* serializeMessageAudience(MessageAudience ma)
     const char* ret;
     switch(ma)
     {
-    case MSGAUD_unknown:     ret = "unknown";       break;
     case MSGAUD_operator:    ret = "operator";      break;
     case MSGAUD_user:        ret = "user";          break;
-    case MSGAUD_monitor:     ret = "monitor";       break;
-    case MSGAUD_performance: ret = "performance";   break;
-    case MSGAUD_internal:    ret = "internal";      break;
     case MSGAUD_programmer:  ret = "programmer";    break;
     case MSGAUD_legacy:      ret = "legacy";        break;
     case MSGAUD_all:         ret = "all";           break;
@@ -305,19 +301,13 @@ const char* serializeMessageAudience(MessageAudience ma)
 
 MessageAudience deserializeMessageAudience(const char* text)
 {
-    MessageAudience ma = MSGAUD_unknown;
+    MessageAudience ma = MSGAUD_programmer;
     if (text && *text)
     {
         if (!strcmp(text, "operator"))
             ma = MSGAUD_operator;
         else if (!strcmp(text, "user"))
             ma = MSGAUD_user;
-        else if (!strcmp(text, "monitor"))
-            ma = MSGAUD_monitor;
-        else if (!strcmp(text, "performance"))
-            ma = MSGAUD_performance;
-        else if (!strcmp(text, "internal"))
-            ma = MSGAUD_internal;
         else if (!strcmp(text, "programmer"))
             ma = MSGAUD_programmer;
         else if (!strcmp(text, "legacy"))
@@ -564,7 +554,7 @@ public:
     virtual MessageAudience errorAudience() const
     { 
         synchronized block(m_mutex);
-        return ordinality() == 1 ? item(0).errorAudience() : MSGAUD_unknown; 
+        return ordinality() == 1 ? item(0).errorAudience() : MSGAUD_programmer;
     }
     
 private:

+ 1 - 1
system/jlib/jisem.hpp

@@ -31,7 +31,7 @@ public:
     IMPLEMENT_IINTERFACE;
     virtual int             errorCode() const { return 0; }
     virtual StringBuffer &  errorMessage(StringBuffer &msg) const { return msg.append("Semaphore interrupted"); }
-    virtual MessageAudience errorAudience() const { return MSGAUD_unknown; }
+    virtual MessageAudience errorAudience() const { return MSGAUD_programmer; }
 };
 
 class jlib_decl InterruptableSemaphore : public Semaphore

+ 5 - 5
system/jlib/jlog.cpp

@@ -2185,16 +2185,16 @@ void attachManyLogMsgMonitorsFromPTree(IPropertyTree * tree)
 const LogMsgCategory MCdisaster(MSGAUD_all, MSGCLS_disaster);
 const LogMsgCategory MCuserError(MSGAUD_user, MSGCLS_error);
 const LogMsgCategory MCoperatorError(MSGAUD_operator, MSGCLS_error);
-const LogMsgCategory MCinternalError((LogMsgAudience)(MSGAUD_internal & MSGAUD_programmer), MSGCLS_error, 1);
+const LogMsgCategory MCinternalError(MSGAUD_programmer, MSGCLS_error, 1);
 const LogMsgCategory MCuserWarning(MSGAUD_user, MSGCLS_warning);
 const LogMsgCategory MCoperatorWarning(MSGAUD_operator, MSGCLS_warning);
-const LogMsgCategory MCinternalWarning((LogMsgAudience)(MSGAUD_internal & MSGAUD_programmer), MSGCLS_warning, 1);
+const LogMsgCategory MCinternalWarning(MSGAUD_programmer, MSGCLS_warning, 1);
 const LogMsgCategory MCuserProgress(MSGAUD_user, MSGCLS_progress);
 const LogMsgCategory MCoperatorProgress(MSGAUD_operator, MSGCLS_progress);
 const LogMsgCategory MCdebugProgress(MSGAUD_programmer, MSGCLS_progress);
 const LogMsgCategory MCdebugInfo(MSGAUD_programmer, MSGCLS_information);
-const LogMsgCategory MCstats(MSGAUD_performance, MSGCLS_information);
-const LogMsgCategory MCevent(MSGAUD_monitor, MSGCLS_event);
+const LogMsgCategory MCstats(MSGAUD_operator, MSGCLS_progress);
+const LogMsgCategory MCoperatorInfo(MSGAUD_operator, MSGCLS_information);
 const LogMsgCategory MClegacy(MSGAUD_legacy, MSGCLS_legacy, DefaultDetail);
 
 const LogMsgJobInfo unknownJob(UnknownJob, UnknownUser);
@@ -2664,7 +2664,7 @@ extern jlib_decl void UseSysLogForOperatorMessages(bool use)
         return;
     if (use) {
         msgHandler = getSysLogMsgHandler();
-        ILogMsgFilter * operatorFilter = getCategoryLogMsgFilter(MSGAUD_operator|MSGAUD_monitor, MSGCLS_all, DefaultDetail, true);  
+        ILogMsgFilter * operatorFilter = getCategoryLogMsgFilter(MSGAUD_operator, MSGCLS_all, DefaultDetail, true);  
         queryLogMsgManager()->addMonitorOwn(msgHandler, operatorFilter);
     }
     else {

+ 9 - 30
system/jlib/jlog.hpp

@@ -54,12 +54,6 @@ inline const char * LogMsgAudienceToVarString(LogMsgAudience audience)
         return("Operator");
     case MSGAUD_user:
         return("User");
-    case MSGAUD_monitor:
-        return("Monitor");
-    case MSGAUD_performance:
-        return("Performance");
-    case MSGAUD_internal:
-        return("Internal");
     case MSGAUD_programmer:
         return("Programmer");
     case MSGAUD_legacy:
@@ -79,12 +73,6 @@ inline const char * LogMsgAudienceToFixString(LogMsgAudience audience)
         return("Operator ");
     case MSGAUD_user:
         return("User     ");
-    case MSGAUD_monitor:
-        return("Monitor  ");
-    case MSGAUD_performance:
-        return("Perf.    ");
-    case MSGAUD_internal:
-        return("Internal ");
     case MSGAUD_programmer:
         return("Prog.    ");
     case MSGAUD_legacy:
@@ -100,15 +88,13 @@ inline const char * LogMsgAudienceToFixString(LogMsgAudience audience)
 
 typedef enum
 {
-    MSGCLS_unknown     = 0x00,
-    MSGCLS_disaster    = 0x01,
-    MSGCLS_error       = 0x02,
-    MSGCLS_warning     = 0x04,
-    MSGCLS_information = 0x08,
-    MSGCLS_progress    = 0x10,
-    MSGCLS_legacy      = 0x20,
-    MSGCLS_event       = 0x40,
-    MSGCLS_all         = 0xFF
+    MSGCLS_disaster    = 0x01, /* Any unrecoverable or critical system errors */
+    MSGCLS_error       = 0x02, /* Recoverable/not critical Errors */
+    MSGCLS_warning     = 0x04, /* Warnings */
+    MSGCLS_information = 0x08, /* Config, environmental and internal status  info */
+    MSGCLS_progress    = 0x10, /* Progress of workunits. Status of file operations*/
+    MSGCLS_legacy      = 0x20, /* TODO: to be removed */
+    MSGCLS_all         = 0xFF  /* Use as a filter to select all messages */
 } LogMsgClass;
 
 #define MSGCLSNUM 7
@@ -129,8 +115,6 @@ inline const char * LogMsgClassToVarString(LogMsgClass msgClass)
         return("Progress");
     case MSGCLS_legacy:
         return("Legacy");
-    case MSGCLS_event:
-        return("Event");
     default:
         return("UNKNOWN");
     }
@@ -150,10 +134,6 @@ inline const char * LogMsgClassToFixString(LogMsgClass msgClass)
         return("Inform.  ");
     case MSGCLS_progress:
         return("Progress ");
-    case MSGCLS_legacy:
-        return("Legacy   ");
-    case MSGCLS_event:
-        return("Event    ");
     default:
         return("UNKNOWN  ");
     }
@@ -365,7 +345,7 @@ inline char const * msgPrefix(LogMsgClass msgClass)
 class jlib_decl LogMsgCategory
 {
 public:
-    LogMsgCategory(LogMsgAudience _audience = MSGAUD_unknown, LogMsgClass _class = MSGCLS_unknown, LogMsgDetail _detail = DefaultDetail) : audience(_audience), msgClass(_class), detail(_detail) {}
+    LogMsgCategory(LogMsgAudience _audience = MSGAUD_programmer, LogMsgClass _class = MSGCLS_information, LogMsgDetail _detail = DefaultDetail) : audience(_audience), msgClass(_class), detail(_detail) {}
     inline LogMsgAudience     queryAudience() const { return audience; }
     inline LogMsgClass        queryClass() const { return msgClass; }
     inline LogMsgDetail       queryDetail() const { return detail; }
@@ -703,7 +683,7 @@ extern jlib_decl const LogMsgCategory MCoperatorProgress;
 extern jlib_decl const LogMsgCategory MCdebugProgress;
 extern jlib_decl const LogMsgCategory MCdebugInfo;
 extern jlib_decl const LogMsgCategory MCstats;
-extern jlib_decl const LogMsgCategory MCevent;
+extern jlib_decl const LogMsgCategory MCoperatorInfo;
 extern jlib_decl const LogMsgCategory MClegacy;
 
 extern jlib_decl const LogMsgJobInfo unknownJob;
@@ -804,7 +784,6 @@ inline void VALOG(const LogMsgCategory & cat, const LogMsgJobInfo & job, LogMsgC
 #define CHRLOG(category, job, expr) LOGMSGREPORTER->report(category, job, #expr"=%c", expr)
 #define STRLOG(category, job, expr) LOGMSGREPORTER->report(category, job, #expr"='%s'", expr)
 #define TOSTRLOG(category, job, prefix, func) { if (!REJECTLOG(category)) { StringBuffer buff; func(buff); LOGMSGREPORTER->report(category, job, prefix"'%s'", buff.str()); } }
-#define EVENTLOG(code, extra) LOGMSGREPORTER->report(MCevent, unknownJob, code, extra)
 
 inline void DBGLOG(char const * format, ...) __attribute__((format(printf, 1, 2)));
 inline void DBGLOG(char const * format, ...)

+ 14 - 4
system/jlib/jscm.hpp

@@ -183,15 +183,25 @@ class StringBuffer;
 
 typedef enum
 {
-    MSGAUD_unknown     = 0x00,
+    // Target audience: sysadmins
+    // Purpose: Information useful for administering the platform, diagnosing errors and 
+    //          resolving system issues
     MSGAUD_operator    = 0x01,
+    // Target audience: ECL developers
+    // Purpose: Information useful for diagnosing and resolving issues (performance and faults)
+    //          in the execution ECL queries
     MSGAUD_user        = 0x02,
-    MSGAUD_monitor     = 0x04,
-    MSGAUD_performance = 0x08,
-    MSGAUD_internal    = 0x10,
+    // Target audience: HPCC Platform developers
+    // Purpose: Information related to errors relating to potential bugs or any unexpected errors that
+    //          would not be resolvable by sysadmin or ECL developers. Additional information that may
+    //          be useful for improving the platform. 
     MSGAUD_programmer  = 0x20,
+    // TODO: to be removed
     MSGAUD_legacy      = 0x40,
+    // Target audience: persons involved in accounting and security audits 
     MSGAUD_audit       = 0x80,
+    // MSGAUD_all is to be used for filtering or specifying which messages are to be logged
+    // (A message itself should not be logged as MSGAUD_all)
     MSGAUD_all         = 0xFF
 } MessageAudience;