From ecc68fa4fbb579e97ea45156e79a293b073697a0 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Thu, 10 Jun 2010 10:35:31 -0700 Subject: Switch bitbake internals to use logging directly rather than bb.msg We use a custom Logger subclass for our loggers This logger provides: - 'debug' method which accepts a debug level - 'plain' method which bypasses log formatting - 'verbose' method which is more detail than info, but less than debug (Bitbake rev: 3b2c1fe5ca56daebb24073a9dd45723d3efd2a8d) Signed-off-by: Chris Larson Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch/wget.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'bitbake/lib/bb/fetch/wget.py') diff --git a/bitbake/lib/bb/fetch/wget.py b/bitbake/lib/bb/fetch/wget.py index 18503a03f..4d4bdfd49 100644 --- a/bitbake/lib/bb/fetch/wget.py +++ b/bitbake/lib/bb/fetch/wget.py @@ -26,13 +26,11 @@ BitBake build tools. # Based on functions from the base bb module, Copyright 2003 Holger Schurig import os +import logging import bb import urllib from bb import data -from bb.fetch import Fetch -from bb.fetch import FetchError -from bb.fetch import encodeurl, decodeurl -from bb.fetch import runfetchcmd +from bb.fetch import Fetch, FetchError, encodeurl, decodeurl, logger, runfetchcmd class Wget(Fetch): """Class to fetch urls via 'wget'""" @@ -69,15 +67,14 @@ class Wget(Fetch): fetchcmd = fetchcmd.replace("${URI}", uri.split(";")[0]) fetchcmd = fetchcmd.replace("${FILE}", ud.basename) - - bb.msg.note(1, bb.msg.domain.Fetcher, "fetch " + uri) - bb.msg.debug(2, bb.msg.domain.Fetcher, "executing " + fetchcmd) + logger.info("fetch " + uri) + logger.debug(2, "executing " + fetchcmd) runfetchcmd(fetchcmd, d) # Sanity check since wget can pretend it succeed when it didn't # Also, this used to happen if sourceforge sent us to the mirror page if not os.path.exists(ud.localpath) and not checkonly: - bb.msg.debug(2, bb.msg.domain.Fetcher, "The fetch command for %s returned success but %s doesn't exist?..." % (uri, ud.localpath)) + logger.debug(2, "The fetch command for %s returned success but %s doesn't exist?...", uri, ud.localpath) return False return True -- cgit v1.2.3