Skip to content

Commit

Permalink
Merge pull request #31 from rohanpm/fixlogger
Browse files Browse the repository at this point in the history
Fix logger per pubtools conventions
  • Loading branch information
rohanpm committed Jul 12, 2021
2 parents 5fadb70 + bb346eb commit fc85454
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/source/CHANGELOG.rst
Expand Up @@ -3,6 +3,7 @@ ChangeLog

Unreleased
-----------
* Use pubtools.iib logger rather than root logger

0.20.0 (2021-06-10)
-------------------
Expand Down
8 changes: 6 additions & 2 deletions pubtools/iib/iib_ops.py
Expand Up @@ -13,8 +13,8 @@
from pubtools import pulplib
import pushcollector

LOG = logging.getLogger()
LOG.setLevel(logging.INFO)
LOG = logging.getLogger("pubtools.iib")


CMD_ARGS = {
("--pulp-url",): {
Expand Down Expand Up @@ -314,6 +314,8 @@ def make_rm_operators_parser():


def add_bundles_main(sysargs=None):
logging.basicConfig(level=logging.INFO)

parser = make_add_bundles_parser()
if sysargs:
args = parser.parse_args(sysargs[1:])
Expand All @@ -325,6 +327,8 @@ def add_bundles_main(sysargs=None):


def remove_operators_main(sysargs=None):
logging.basicConfig(level=logging.INFO)

parser = make_rm_operators_parser()
if sysargs:
args = parser.parse_args(sysargs[1:])
Expand Down
2 changes: 2 additions & 0 deletions tests/test_iib_ops.py
@@ -1,4 +1,5 @@
import contextlib
import logging
import mock
import pkg_resources
import pytest
Expand Down Expand Up @@ -421,6 +422,7 @@ def test_add_bundles_py(
fixture_container_image_repo,
fixture_common_iib_op_args,
):
caplog.set_level(logging.INFO)
repo = fixture_container_image_repo
fixture_pulp_client.return_value.search_repository.return_value = [repo]
fixture_pulp_client.return_value.get_repository.return_value = repo
Expand Down

0 comments on commit fc85454

Please sign in to comment.