Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
# Enable debug logging
if args.debug:
- log.setLevel(logging.DEBUG)
+ location.logger.set_level(logging.DEBUG)
# Print usage if no action was given
if not "func" in args:
# Enable debug logging
if args.debug:
- log.setLevel(logging.DEBUG)
+ location.logger.set_level(logging.DEBUG)
return args
# Enable debug logging
if args.debug:
- log.setLevel(logging.DEBUG)
+ location.logger.set_level(logging.DEBUG)
# Print usage if no action was given
if not "func" in args:
args = parser.parse_args()
+ # Enable debug logging
+ if args.debug:
+ location.logger.set_level(logging.DEBUG)
+
# Print usage if no action was given
if not "func" in args:
parser.print_usage()
# Initialise root logger
log = logging.getLogger("location")
-log.setLevel(logging.DEBUG)
+log.setLevel(logging.INFO)
# Log to console
handler = logging.StreamHandler()
# Format syslog messages
formatter = logging.Formatter("%(message)s")
handler.setFormatter(formatter)
+
+def set_level(level):
+ """
+ Sets the log level for the root logger
+ """
+ log.setLevel(level)