diff options
author | bergstra <james@xo-05-28-3A.localdomain> | 2008-02-13 02:13:10 (GMT) |
---|---|---|
committer | bergstra <james@xo-05-28-3A.localdomain> | 2008-02-13 02:13:10 (GMT) |
commit | 4069e31deead331593be3827b696a98b6ea37e61 (patch) | |
tree | dcf32dd3db9a8dfe0767964d456e9653c147cbe2 /common/Config.py | |
parent | 7883aaaa52dec4ba53dfeb765004e0e91446aad5 (diff) |
added logging of csound connect to Jam, Synth
Diffstat (limited to 'common/Config.py')
-rw-r--r-- | common/Config.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/common/Config.py b/common/Config.py index 3a0ed11..8019334 100644 --- a/common/Config.py +++ b/common/Config.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -import os +import os, sys, time from sugar.activity.activity import get_bundle_path from sugar import env @@ -18,6 +18,17 @@ else: DEBUG = 0 print "Debug Level %d" % (DEBUG) +# TODO: move this into a logging file in Util/ +# TODO: consider python's logging utility from the stdlib +def logwrite(level, msg): + global DEBUG + if level <= DEBUG: + if not hasattr(logwrite, 'file'): + logwrite.file = sys.stdout + print >> logwrite.file, 'L%i:%f: %s'% (level, time.time(), msg) + logwrite.file.flush() + + TAM_TAM_ROOT = get_bundle_path() print 'INFO: loaded TAMTAM_ROOT=%s' % TAM_TAM_ROOT @@ -49,8 +60,8 @@ else: SCRATCH_DIR = PREF_DIR + "/.scratch/" #PLUGIN -PLUGIN_DEBUG = PREF_DIR + "/clooper.log" -PLUGIN_VERBOSE = 0 +PLUGIN_DEBUG = "STDERR" +PLUGIN_VERBOSE = DEBUG PLUGIN_UNIVORC = TAM_TAM_ROOT + "/common/Resources/tamtamorc.csd" PLUGIN_KSMPS = 64 PLUGIN_RATE = 16000 |