Commit ea34193f authored by Iustin Pop's avatar Iustin Pop
Browse files

Change the debug CLI option to integer/count

This changes from boolean to integer/count (for a future differentiation
based on the actual debug level). All the uses of the code only test
it's boolean status, so it still works as an integer value.
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarMichael Hanselmann <>
parent ee844e20
......@@ -483,9 +483,8 @@ cli_option = CliOption
_YESNO = ("yes", "no")
_YORNO = "yes|no"
DEBUG_OPT = cli_option("-d", "--debug", default=False,
help="Turn debugging on")
DEBUG_OPT = cli_option("-d", "--debug", default=0, action="count",
help="Increase debugging level")
NOHDR_OPT = cli_option("--no-headers", default=False,
action="store_true", dest="no_headers",
......@@ -1762,14 +1762,14 @@ def GetDaemonPort(daemon_name):
return port
def SetupLogging(logfile, debug=False, stderr_logging=False, program="",
def SetupLogging(logfile, debug=0, stderr_logging=False, program="",
multithreaded=False, syslog=constants.SYSLOG_USAGE):
"""Configures the logging module.
@type logfile: str
@param logfile: the filename to which we should log
@type debug: boolean
@param debug: whether to enable debug messages too or
@type debug: integer
@param debug: if greater than zero, enable debug messages, otherwise
only those at C{INFO} and above level
@type stderr_logging: boolean
@param stderr_logging: whether we should also log to the standard error
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