Commit 018e572d authored by André Anjos's avatar André Anjos 💬
Browse files

[build] Avoid double-logging after importing conda modules

parent a700c950
...@@ -14,12 +14,23 @@ import platform ...@@ -14,12 +14,23 @@ import platform
import subprocess import subprocess
import logging import logging
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
import yaml import yaml
import distutils.version import distutils.version
def remove_conda_loggers():
"""Cleans-up conda API logger handlers to avoid logging repetition"""
z = logging.getLogger() #conda places their handlers inside root
if z.handlers:
handler = z.handlers[0]
z.removeHandler(handler)
logger.debug("Removed conda logger handler at %s", handler)
import conda_build.api import conda_build.api
remove_conda_loggers()
def comment_cleanup(lines): def comment_cleanup(lines):
...@@ -83,6 +94,7 @@ def next_build_number(channel_url, basename): ...@@ -83,6 +94,7 @@ def next_build_number(channel_url, basename):
""" """
from conda.exports import get_index from conda.exports import get_index
remove_conda_loggers()
# get the channel index # get the channel index
logger.debug("Downloading channel index from %s", channel_url) logger.debug("Downloading channel index from %s", channel_url)
...@@ -164,6 +176,7 @@ def make_conda_config(config, python, append_file, condarc_options): ...@@ -164,6 +176,7 @@ def make_conda_config(config, python, append_file, condarc_options):
""" """
from conda_build.conda_interface import url_path from conda_build.conda_interface import url_path
remove_conda_loggers()
retval = conda_build.api.get_or_merge_config( retval = conda_build.api.get_or_merge_config(
None, None,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment