Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -vv TRACE logging level #382

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/auditwheel/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@
args = p.parse_args()

logging.disable(logging.NOTSET)
if args.verbose >= 1:
logging.basicConfig(level=logging.DEBUG)
else:
logging.basicConfig(level=logging.INFO)
TRACE = 5
logging.addLevelName(TRACE, "TRACE")
logging.basicConfig(level=logging.INFO)
if args.verbose == 1:
logging.getLogger().setLevel(logging.DEBUG)
elif args.verbose > 1:
logging.getLogger().setLevel(TRACE)

Check warning on line 56 in src/auditwheel/main.py

View check run for this annotation

Codecov / codecov/patch

src/auditwheel/main.py#L56

Added line #L56 was not covered by tests

if not hasattr(args, "func"):
p.print_help()
Expand Down
4 changes: 2 additions & 2 deletions src/auditwheel/policy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging
import platform as _platform_module
import sys
from collections import defaultdict
from collections import defaultdict, OrderedDict
from os.path import abspath, dirname, join
from pathlib import Path
from typing import Dict, List, Optional, Set
Expand Down Expand Up @@ -102,7 +102,7 @@ def _fixup_musl_libc_soname(whitelist):

with _POLICY_JSON_MAP[_LIBC].open() as f:
_POLICIES = []
_policies_temp = json.load(f)
_policies_temp = json.load(f, object_pairs_hook=OrderedDict)
_validate_pep600_compliance(_policies_temp)
for _p in _policies_temp:
if _MUSL_POLICY is not None and _p["name"] not in {"linux", _MUSL_POLICY}:
Expand Down
11 changes: 7 additions & 4 deletions src/auditwheel/policy/versioned_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from . import load_policies

log = logging.getLogger(__name__)
TRACE = 5


def versioned_symbols_policy(versioned_symbols: Dict[str, Set[str]]) -> int:
Expand All @@ -13,12 +14,14 @@ def policy_is_satisfied(
policy_satisfied = True
for name in set(required_vers) & set(policy_sym_vers):
if not required_vers[name].issubset(policy_sym_vers[name]):
log.debug(
"Package requirements incompatible with policy %s",
policy_name)
for symbol in required_vers[name] - policy_sym_vers[name]:
log.debug(
"Package requires %s, incompatible with "
"policy %s which requires %s",
log.log(
TRACE,
" %s is incompatible with %s",
symbol,
policy_name,
policy_sym_vers[name],
)
policy_satisfied = False
Expand Down