Skip to content

Commit

Permalink
Merge pull request openwallet-foundation#27 from dbluhm/medici
Browse files Browse the repository at this point in the history
Filter out "not a validator" errors
  • Loading branch information
burdettadam authored Oct 21, 2019
2 parents 498b1b4 + 045d30b commit 539158a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions aries_cloudagent/config/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ def load_resource(path: str, encoding: str = None) -> TextIO:
pass


def not_a_validator_filter(record):
"""Filter out 'not a Validator' errors."""
if record.name == 'indy.libindy.native.indy.services.pool.pool':
if len(record.args) > 1 and record.args[2].find('Node is not a Validator'):
return 0
return 1


class LoggingConfigurator:
"""Utility class used to configure logging and print an informative start banner."""

Expand Down Expand Up @@ -75,6 +83,10 @@ def configure(
log_level = log_level.upper()
logging.root.setLevel(log_level)

if logging.root.hasHandlers():
handler = logging.root.handlers[0]
handler.addFilter(not_a_validator_filter)

@classmethod
def print_banner(
cls,
Expand Down

0 comments on commit 539158a

Please sign in to comment.