# HG changeset patch # User Zach Welch zach@mandolincreekfarm.com
Suppress startup debugging messages (#2347)
This patch changes the verbose startup messages to use LOG.info calls. This change is required to make the CLI remotely usable, as it's unreasonable to print so much information in that context.
I kept this separate from the last patch, because I can imagine that this might impact the automated/buildbot testing. To avoid regressions, the previous output can be generated by setting 'CHIRP_DEBUG=info' in the environment.
diff --git a/chirp/directory.py b/chirp/directory.py index 5fc47e3..07308ee 100644 --- a/chirp/directory.py +++ b/chirp/directory.py @@ -16,10 +16,13 @@
import os import tempfile +import logging
from chirp import icf from chirp import chirp_common, util, rfinder, radioreference, errors
+LOG = logging.getLogger(__name__) + def radio_class_id(cls): """Return a unique identification string for @cls""" ident = "%s_%s" % (cls.VENDOR, cls.MODEL) @@ -47,12 +50,12 @@ def register(cls): ident = radio_class_id(cls) if ident in DRV_TO_RADIO.keys(): if ALLOW_DUPS: - print "Replacing existing driver id `%s'" % ident + LOG.warn("Replacing existing driver id `%s'" % ident) else: raise Exception("Duplicate radio driver id `%s'" % ident) DRV_TO_RADIO[ident] = cls RADIO_TO_DRV[cls] = ident - print "Registered %s = %s" % (ident, cls.__name__) + LOG.info("Registered %s = %s" % (ident, cls.__name__))
return cls
diff --git a/chirpui/mainapp.py b/chirpui/mainapp.py index 79f6815..2d8e3e1 100644 --- a/chirpui/mainapp.py +++ b/chirpui/mainapp.py @@ -21,11 +21,14 @@ import webbrowser from glob import glob import shutil import time +import logging
import gtk import gobject gobject.threads_init()
+LOG = logging.getLogger(__name__) + if __name__ == "__main__": import sys sys.path.insert(0, "..") @@ -526,7 +529,7 @@ If you think that it is valid, you can select a radio model below to force an op files = glob(os.path.join(basepath, "*.csv")) for fn in files: if os.path.exists(os.path.join(stock_dir, os.path.basename(fn))): - print "Skipping existing stock config" + LOG.info("Skipping existing stock config") continue try: shutil.copy(fn, stock_dir)