Skip to content

Commit

Permalink
Patch awx logging to allow trace logging in all cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpapaioa committed Apr 18, 2024
1 parent 93b846d commit 1cee6a4
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions broker/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ def redact_dynaconf(self, data):


def patch_awx_for_verbosity(api):
"""Patch the awxkit API to log when we're at trace level."""
client = api.client
awx_log = client.log

"""Patch the awxkit API to enable trace-level logging of API calls to Ansible provider."""
awx_log = api.client.log
awx_log.parent = logzero.logger

def patch(cls, name):
Expand Down Expand Up @@ -143,10 +141,7 @@ def setup_logzero(
):
"""Call logzero setup with the given settings."""
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# FIXME helpers.update_log_level also needs to do this,
# if "--log-level trace" is passed to the CLI.
if isinstance(level, str) and level.lower() == "trace":
patch_awx_for_verbosity(awxkit.api)
patch_awx_for_verbosity(awxkit.api)
set_log_level(level)
set_file_logging(file_level, path)
if formatter:
Expand Down

0 comments on commit 1cee6a4

Please sign in to comment.