Allow specifying debug path through the environment.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
This commit is contained in:
brian m. carlson 2014-09-18 10:52:02 +00:00
parent 08cb029916
commit 9727fc5967
No known key found for this signature in database
GPG key ID: BF535D811F52F68B

View file

@ -28,8 +28,12 @@ logfd = None
def log(*args):
global logfd
try:
path = os.environ['NEWFOL_DEBUG']
except:
return
if logfd is None:
logfd = open(os.path.expanduser('~/newfol_debug.log'), "w")
logfd = open(path, "w")
logfd.write(" ".join(*args))
logfd.flush()