From 0087893bf3ab504ec009b6a1bcb21e5e56a5126e Mon Sep 17 00:00:00 2001 From: ben-spiller Date: Wed, 26 Jan 2022 13:12:18 +0000 Subject: [PATCH] correct confusing log message --- apamax/log_analyzer.py | 4 ++-- tests/correctness/Cor_020/pysystest.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apamax/log_analyzer.py b/apamax/log_analyzer.py index 818420d..533156a 100755 --- a/apamax/log_analyzer.py +++ b/apamax/log_analyzer.py @@ -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 @@ -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(' ') 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'] diff --git a/tests/correctness/Cor_020/pysystest.py b/tests/correctness/Cor_020/pysystest.py index 9f64916..e9ad0bb 100644 --- a/tests/correctness/Cor_020/pysystest.py +++ b/tests/correctness/Cor_020/pysystest.py @@ -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']