diff options
author | Siddharth Ravikumar <sravik@bgsu.edu> | 2015-10-17 21:31:37 -0400 |
---|---|---|
committer | Siddharth Ravikumar <sravik@bgsu.edu> | 2015-10-17 21:31:37 -0400 |
commit | bc950b732276177c557af39575e5892bbf506cab (patch) | |
tree | c1cdc8201fca6ffacd9c1105b26d9579415cbc26 /combox/cbox.py | |
parent | df9497d7c18a6dc7e7a284b7087765ca464e8a6b (diff) |
combox now uses python's logging module instead of `print` to stdout information/errors.
modified: ChangeLog
modified: combox/cbox.py
modified: combox/events.py
modified: combox/file.py
modified: combox/log.py
Diffstat (limited to 'combox/cbox.py')
-rw-r--r-- | combox/cbox.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/combox/cbox.py b/combox/cbox.py index b1a9ca0..3184a92 100644 --- a/combox/cbox.py +++ b/combox/cbox.py @@ -31,7 +31,7 @@ from watchdog.observers import Observer from combox.config import config_cb, get_nodedirs from combox.events import ComboxDirMonitor, NodeDirMonitor - +from combox.log import log_i, log_e ## Function adapted from Watchdog's docs: ## http://pythonhosted.org/watchdog/quickstart.html#quickstart @@ -71,7 +71,7 @@ def run_cb(config): # Make the first node monitor do the housekeeping. nd_monitors[0].housekeep() - print "Hit Ctrl-C to quit." + log_i("Hit Ctrl-C to quit") try: while True: time.sleep(1) @@ -82,7 +82,7 @@ def run_cb(config): nd_observers[i].join() cd_observer.join() - print "combox exiting. Bye!" + log_i("combox exiting. Bye!") def main(): """ @@ -100,7 +100,7 @@ def main(): config_file = path.join(CONFIG_DIR, 'config.yaml') - print CONFIG_DIR + log_i(CONFIG_DIR) if not path.exists(CONFIG_DIR): # combox not configured. @@ -108,7 +108,7 @@ def main(): try: config = yaml.load(file(config_file, 'r')) except yaml.YAMLError, exc: - print "Error opening configuration file:", exc + log_e("Error opening configuration file: %r" % exc) exit(1) # run combox. |