## @package tracing
# The tracing module for debug-purpose.

import logging
import logging.handlers

log = None

## Setup the debug traces.
# The traces can be logged to console and/or file.
# When logged to file a logrotate is used.
# @param path the path for the traces_settings.txt file. 
def setupDebugTraces(path):
	global log
	log = logging.getLogger("localsettings_app")
	log.setLevel(logging.DEBUG)
	log.disabled = False
	sth = logging.StreamHandler()
	sth.setLevel(logging.DEBUG)
	log.addHandler(sth)
	fd = logging.handlers.RotatingFileHandler(path + 'traces_settings.txt', maxBytes=1048576, backupCount=5)
	fmt = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
	fd.setFormatter(fmt)
	fd.setLevel(logging.DEBUG)
	#log.addHandler(fd)


@@ -104,16 +104,37 @@
 g = None
+%0Alevel = logging.INFO
 %0A%0A## Set
@@ -346,16 +346,30 @@
 bal log%0A
+%09global level%0A
 %09log = l
@@ -417,36 +417,28 @@
 g.setLevel(l
-ogging.DEBUG
+evel
 )%0A%09log.disab
@@ -495,31 +495,24 @@
 tLevel(l
-ogging.DEBUG
+evel
 )%0A%09
+#
 log.addH
@@ -735,24 +735,15 @@
 el(l
-ogging.DEBUG
+evel
 )%0A%09
-#
 log.

set tracing level to info and disable console tracing