summaryrefslogtreecommitdiff
path: root/lib/thandy/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/thandy/util.py')
-rw-r--r--lib/thandy/util.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/thandy/util.py b/lib/thandy/util.py
index 6b75ece..1fbff81 100644
--- a/lib/thandy/util.py
+++ b/lib/thandy/util.py
@@ -1,5 +1,6 @@
# Copyright 2008 The Tor Project, Inc. See LICENSE for licensing information.
+import logging
import os
import sys
import tempfile
@@ -53,6 +54,7 @@ def userFilename(name):
except KeyError:
base = "~/.thandy"
+ base = os.path.expanduser(base)
result = os.path.normpath(os.path.join(base, name))
ensureParentDir(result)
return result
@@ -141,3 +143,10 @@ def getRegistryValue(keyname):
finally:
if settings is not None:
settings.Close()
+
+_controlLog = logging.getLogger("thandy-ctrl")
+
+def logCtrl(key, **args):
+ """DOCDOC"""
+ _controlLog.log(logging.INFO, key, extra={'cmd_args':args})
+