From 4069e31deead331593be3827b696a98b6ea37e61 Mon Sep 17 00:00:00 2001 From: bergstra Date: Wed, 13 Feb 2008 02:13:10 +0000 Subject: added logging of csound connect to Jam, Synth --- (limited to 'common') 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 -- cgit v0.9.1