Skip to content

Commit

Permalink
messaging #843 better info for analysts
Browse files Browse the repository at this point in the history
  • Loading branch information
petersilva authored and petersilva committed Nov 29, 2023
1 parent aa57399 commit 2617a2f
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions sarracenia/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ def _parse_binding(self, subtopic_string):

if type(subtopic_string) is str:
if not hasattr(self, 'broker') or self.broker is None or self.broker.url is None:
logger.error( f'{self.files}{self.lineno} broker needed before subtopic' )
logger.error( f'{self.files}:{self.lineno} broker needed before subtopic' )
return

if self.broker.url.scheme == 'amq' :
Expand Down Expand Up @@ -1485,7 +1485,7 @@ def parse_file(self, cfg, component=None):
continue

if len(line) < 2:
logger.error( f'{self.files} {lineno} {k} missing argument(s) ' )
logger.error( f'{self.files}:{lineno} {k} missing argument(s) ' )
continue
if k in ['accept', 'reject' ]:
self.masks.append(self._build_mask(k, line[1:]))
Expand Down Expand Up @@ -1627,7 +1627,7 @@ def parse_file(self, cfg, component=None):
if k in set_choices :
for i in getattr(self,k):
if i not in set_choices[k]:
logger.error('{self.files}:{lineno} invalid entry for %s: %s. Must be one of: %s' % ( k, i, set_choices[k] ) )
logger.error( f'{self.files}:{lineno} invalid entry for {k}: {i}. Must be one of: {set_choices[k]}' )

elif k in str_options:
v = ' '.join(line[1:])
Expand All @@ -1637,7 +1637,7 @@ def parse_file(self, cfg, component=None):
else:
#FIXME: with _options lists for all types and addition of declare, this is probably now dead code.
if k not in self.undeclared:
logger.debug('{self.files} {self.lineno} possibly undeclared option: %s' % line )
logger.debug( f'{self.files}:{self.lineno} possibly undeclared option: {line}' )
v = ' '.join(line[1:])
if hasattr(self, k):
if type(getattr(self, k)) is float:
Expand Down Expand Up @@ -1870,7 +1870,7 @@ def finalize(self, component=None, config=None):
queueName += '.' + str(randint(0, 100000000)).zfill(8)
queueName += '.' + str(randint(0, 100000000)).zfill(8)
self.queueName = queueName
logger.debug('default guessed queueName %s ' % self.queueName )
logger.debug( f'default guessed queueName {self.queueName} ' )

if not os.path.isdir(os.path.dirname(queuefile)):
pathlib.Path(os.path.dirname(queuefile)).mkdir(parents=True, exist_ok=True)
Expand Down Expand Up @@ -1941,9 +1941,7 @@ def finalize(self, component=None, config=None):
if self.messageCountMax > 0:
if self.batch > self.messageCountMax:
self.batch = self.messageCountMax
logger.info(
'overriding batch for consistency with messageCountMax: %d'
% self.batch)
logger.info( 'overriding batch for consistency with messageCountMax: {self.batch}' )

if (component not in ['poll' ]):
self.path = list(map( os.path.expanduser, self.path ))
Expand Down

0 comments on commit 2617a2f

Please sign in to comment.