Commit 131e0f9b authored by Matthew Finkel's avatar Matthew Finkel
Browse files

Add utility module with safe logging functions and new SAFELOGGING config option

parent 7bde75e2
......@@ -12,6 +12,9 @@ PIDFILE = "bridgedb.pid"
# Either a file to log to, or None if we should log to the console.
LOGFILE = "bridgedb.log"
# If true, we scrub all potentially identifying information before we log it
SAFELOGGING = True
# Logfile rotation settings
LOGFILE_COUNT = 5
LOGFILE_ROTATE_SIZE = 10000000
......
safe_logging = True
def set_safe_logging(safe):
global safe_logging
safe_logging = safe
def logSafely(val):
if safe_logging:
return "[scrubbed]"
else:
return val
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment