Skip to content

Commit

Permalink
correct confusing log message
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-spiller committed Jan 26, 2022
1 parent 5190bf3 commit 0087893
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apamax/log_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ def preProcessUserStatusLine(self, file, line, m, userStatusPrefix, userStatusCo
if keyedUserStatusAccumulatedMetadata['prevBlockKeys']-keyedUserStatusAccumulatedMetadata['currentBlockKeys']:
changes += ' removed '+', '.join( f'{str(k[1])}=#{str(k[0])}' for k in sorted( keyedUserStatusAccumulatedMetadata['prevBlockKeys']-keyedUserStatusAccumulatedMetadata['currentBlockKeys'] ) )
if changes and keyedUserStatusAccumulatedMetadata['prevBlockKeys']: # except the first line, log these
log.info('The set of %s keys changed at %s (line #%d) of %s log: new size=%s; %s', columnPrefix, line.getDateTimeString(), line.lineno, file['name'], len(keyedUserStatusAccumulatedMetadata['currentBlockKeys']), changes.strip())
log.info('The set of %s keys changed in the block prior to %s (line #%d) of %s log: new size=%s; %s', columnPrefix, line.getDateTimeString(), line.lineno, file['name'], len(keyedUserStatusAccumulatedMetadata['currentBlockKeys']), changes.strip())
#self.userStatus[columnPrefix+'.changes'] = (self.userStatus.get(columnPrefix+'.changes', '')+changes).lstrip() # TODO: shoudn't this be pre-populated?
#self.userStatus[columnPrefix+'.count'] = len(keyedUserStatusAccumulatedMetadata['prevBlockKeys']) # update the count at the end of each block, since that's the first time we know

Expand Down Expand Up @@ -920,7 +920,7 @@ def decideColumns(status):
# since they may come from EPL code that hasn't been injected yet and we can't change the columns later
for msgPrefix, userConfig in self.args.userStatusLines.items():
if msgPrefix[0].startswith('<apama-ctrl> ') and (not file['isApamaCtrl']) and 'true'!=os.getenv('APAMA_LOG_ANALYZER_ASSUME_APAMACTRL',''):
log.info('Not adding column for this prefix as this does not appear to be an apama-ctrl log file by line no #%d: %s', line.lineno, msgPrefix[0])
log.debug('Not adding column for this status line prefix as this does not appear to be an apama-ctrl log file by line no #%d: %s', line.lineno, msgPrefix[0])
continue

addColumnPrefix = userConfig['fieldPrefix']
Expand Down
2 changes: 1 addition & 1 deletion tests/correctness/Cor_020/pysystest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def validate(self):
self.assertGrep('loganalyzer.err', 'Restarting current file due to: file contains apama-ctrl lines which were not detected in first parse attempt')
self.assertGrep('loganalyzer.err', 'Restarting current file due to: hit maxKeysToAllocateColumnsFor limit .*')

self.assertThatGrep('loganalyzer.err', 'The set of ctrlIncomingNode keys changed at Fri 2020-06-12 16:06:20 (.*)',
self.assertThatGrep('loganalyzer.err', 'The set of ctrlIncomingNode keys changed in the block prior to Fri 2020-06-12 16:06:20 (.*)',
expected='(line #211) of correlator log: new size=3; added 127.0.0.4=#4 removed 127.0.0.2=#2')

status = pysys.utils.fileutils.loadJSON(self.output+'/loganalyzer_output/status.correlator.json')['status']
Expand Down

0 comments on commit 0087893

Please sign in to comment.