Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings in Log Analyzer #18

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions apamax/log_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1365,23 +1365,23 @@ def writeSampleLine(prefix, line):
CONNECTION_LINE_REGEX_PRE10_7 = re.compile(
# This regex is for sender/receiver connection lines prior to Apama 10.7(.1);
# the (?P<name>xxxx) syntax identifies named groups in the regular expression
# hack: hope/assume that pointer addresses are always prefixed with 00 on linux
# this regex gets the objectAddr in all cases, and for "slow" messages also the logical/physical ids; for other

# hack: hope/assume that pointer addresses are always prefixed with 00 on linux
# this regex gets the objectAddr in all cases, and for "slow" messages also the logical/physical ids; for other
# messages we separately use CONNECTION_MESSAGE_IDS_REGEX to get those
r"^(?P<prefix>Receiver|Connected to receiver|Blocking receiver) (?P<remoteProcessName>.+) [(]"+\
"(component ID (?P<remotePhysicalId>[0-9]+)/(?P<remoteLogicalId>[0-9]+) \[)?"+\
"(?P<objectAddr>(0x|00)[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]+)\]?[)] (?P<message>.+)"
)
r"(component ID (?P<remotePhysicalId>[0-9]+)/(?P<remoteLogicalId>[0-9]+) \[)?"+\
r"(?P<objectAddr>(0x|00)[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]+)\]?[)] (?P<message>.+)"
)

CONNECTION_LINE_REGEX_POST10_7 = re.compile(
# This regex is for sender/receiver connection lines from Apama 10.7.1 onwards
# the (?P<name>xxxx) syntax identifies named groups in the regular expression
# messages will contain all connected and disconnected lines in newLogFormat
r"^(?P<prefix>External sender|External receiver) \"(?P<remoteProcessName>.+)\" " + \
"<client (?P<remotePhysicalId>[0-9]+), connection (?P<remoteLogicalId>[0-9]+), " + \
"address (?P<host>[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+):(?P<remotePort>[0-9]+)> " + \
"(?P<evtType>connected|disconnected cleanly|disconnected uncleanly|[^:]+): (?P<message>.+)"
r"<client (?P<remotePhysicalId>[0-9]+), connection (?P<remoteLogicalId>[0-9]+), " + \
r"address (?P<host>[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+):(?P<remotePort>[0-9]+)> " + \
r"(?P<evtType>connected|disconnected cleanly|disconnected uncleanly|[^:]+): (?P<message>.+)"
)

def handleConnectionMessage(self, file, line, **extra):
Expand Down Expand Up @@ -2521,7 +2521,7 @@ def main(self, args):
else u'%(levelname)-5s - %(message)s',
stream=sys.stderr, level=loglevel)

log.info('Apama log analyzer v%s (locale=%s)'%(__version__, locale.getdefaultlocale()[0]))
log.info('Apama log analyzer v%s (locale=%s)'%(__version__, locale.getlocale()[0]))

duration = time.time()

Expand Down
Loading