Skip to content

Commit

Permalink
HPCC-30393 Add new event class and monitor audience
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday committed Sep 28, 2023
1 parent 1252258 commit e368073
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions system/jlib/jexcept.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ const char* serializeMessageAudience(MessageAudience ma)
case MSGAUD_operator: ret = "operator"; break;
case MSGAUD_user: ret = "user"; break;
case MSGAUD_programmer: ret = "programmer"; break;
case MSGAUD_monitor: ret = "monitor"; break;
case MSGAUD_all: ret = "all"; break;
default: ret = "unknown"; break;
}
Expand All @@ -319,6 +320,8 @@ MessageAudience deserializeMessageAudience(const char* text)
ma = MSGAUD_user;
else if (!strcmp(text, "programmer"))
ma = MSGAUD_programmer;
else if (!strcmp(text, "monitor"))
ma = MSGAUD_monitor;
else if (!strcmp(text, "all"))
ma = MSGAUD_all;
}
Expand Down
15 changes: 14 additions & 1 deletion system/jlib/jlog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ typedef enum
MSGCLS_metric = 0x20, // A metric line
MSGCLS_addid = 0x40, // Internal use within log system
MSGCLS_removeid = 0x80, // Internal use within log system
MSGCLS_all = 0xFF // Use as a filter to select all messages
MSGCLS_event = 0x100, // A timestamp or event where the time it occurs is significant
MSGCLS_all = 0xFFFF // Use as a filter to select all messages
} LogMsgClass;
/* ------------------------------------------------------------------------------------ *
* NOTES: *
Expand Down Expand Up @@ -141,6 +142,8 @@ inline const char * LogMsgAudienceToVarString(LogMsgAudience audience)
return("User");
case MSGAUD_programmer:
return("Programmer");
case MSGAUD_monitor:
return("Monitor");
case MSGAUD_audit:
return("Audit");
default:
Expand All @@ -158,6 +161,8 @@ inline const char * LogMsgAudienceToFixString(LogMsgAudience audience)
return("USR");
case MSGAUD_programmer:
return("PRG");
case MSGAUD_monitor:
return("MON");
case MSGAUD_audit:
return("AUD");
default:
Expand All @@ -172,6 +177,8 @@ inline MessageAudience LogMsgAudFromAbbrev(char const * abbrev)
return MSGAUD_user;
if(strnicmp(abbrev, "PRO", 3)==0)
return MSGAUD_programmer;
if(strnicmp(abbrev, "MON", 3)==0)
return MSGAUD_monitor;
if(strnicmp(abbrev, "ADT", 3)==0)
return MSGAUD_audit;
if(strnicmp(abbrev, "ALL", 3)==0)
Expand All @@ -195,6 +202,8 @@ inline const char * LogMsgClassToVarString(LogMsgClass msgClass)
return("Progress");
case MSGCLS_metric:
return("Metric");
case MSGCLS_event:
return("Event");
default:
return("UNKNOWN");
}
Expand All @@ -216,6 +225,8 @@ inline const char * LogMsgClassToFixString(LogMsgClass msgClass)
return("PRO");
case MSGCLS_metric:
return("MET");
case MSGCLS_event:
return("EVT");
default:
return("UNK");
}
Expand All @@ -235,6 +246,8 @@ inline LogMsgClass LogMsgClassFromAbbrev(char const * abbrev)
return MSGCLS_progress;
if(strnicmp(abbrev, "MET", 3)==0)
return MSGCLS_metric;
if(strnicmp(abbrev, "EVT", 3)==0)
return MSGCLS_event;
if(strnicmp(abbrev, "ALL", 3)==0)
return MSGCLS_all;
return MSGCLS_unknown;
Expand Down
3 changes: 2 additions & 1 deletion system/jlib/jscm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ typedef enum
// would not be resolvable by sysadmin or ECL developers. Additional information that may
// be useful for improving the platform.
MSGAUD_programmer = 0x20,
// MSGAUD_legacy = 0x40, REMOVED - may be reused later
// Target audience: Automatic monitoring tools
MSGAUD_monitor = 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
Expand Down

0 comments on commit e368073

Please sign in to comment.