From: Markus Lehtonen Date: Thu, 25 Sep 2014 10:04:42 +0000 (+0300) Subject: Use the standard logging module X-Git-Tag: submit/devel/20190730.075437~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f96e0eb51994695ef852718c1c6a7af4c34ceb7e;p=services%2Fobs-service-git-buildpackage.git Use the standard logging module Get rid of the gbp-specific logging in order to diminish dependency to gbp specifics. Change-Id: I39cfb5c3727b5828e63c7932f1dbc0b926d5bf99 Signed-off-by: Markus Lehtonen --- diff --git a/obs_service_gbp/__init__.py b/obs_service_gbp/__init__.py index bfb57d9..43cb263 100644 --- a/obs_service_gbp/__init__.py +++ b/obs_service_gbp/__init__.py @@ -17,11 +17,3 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. """Helpers for the git-buildpackage OBS source service""" - -import gbp.log as gbplog - - -# Setup logging -LOGGER = gbplog.getLogger('source_service') -LOGGER.setLevel(gbplog.INFO) - diff --git a/obs_service_gbp/command.py b/obs_service_gbp/command.py index d5ab1fe..768c235 100644 --- a/obs_service_gbp/command.py +++ b/obs_service_gbp/command.py @@ -20,20 +20,26 @@ import os import argparse +import logging import shutil import tempfile from ConfigParser import SafeConfigParser +import gbp.log as gbplog from gbp.rpm import guess_spec, NoSpecError from gbp.scripts.buildpackage import main as gbp_deb from gbp.scripts.buildpackage_rpm import main as gbp_rpm -from obs_service_gbp import LOGGER, gbplog from obs_service_gbp_utils import (GbpServiceError, GbpChildBTError, fork_call, sanitize_uid_gid, write_treeish_meta, str_to_bool) from gbp_repocache import CachedRepo, CachedRepoError import gbp_repocache + +# Setup module-level logging +LOGGER = logging.getLogger('source_service') + + def have_spec(directory): """Find if the package has spec files""" try: @@ -192,11 +198,13 @@ def main(argv=None): args = parse_args(argv) + logging.basicConfig(level=logging.INFO, + format='%(name)s:%(levelname)s: %(message)s') LOGGER.info('Starting git-buildpackage source service') if args.verbose == 'yes': gbplog.setup(color='auto', verbose=True) - LOGGER.setLevel(gbplog.DEBUG) - gbp_repocache.LOGGER.setLevel(gbplog.DEBUG) + logging.root.setLevel(logging.DEBUG) + gbp_repocache.LOGGER.setLevel(logging.DEBUG) config = read_config(args.config)