pass debug to Conf init, so it can print from the beginnig

This commit is contained in:
Marcus Stoegbauer 2024-03-30 09:19:19 +01:00
parent ee19f4b1b1
commit d8bb56cb7b

View File

@ -17,10 +17,9 @@ def main():
help='userconfig2.cfg config file', help='userconfig2.cfg config file',
dest='file', action='store') dest='file', action='store')
cmdline = parser.parse_args() cmdline = parser.parse_args()
cfg = Conf(cmdline.file)
debug = Debug() debug = Debug()
debug.set_verbose(cmdline.verbose) debug.set_verbose(cmdline.verbose)
cfg.set_debug(debug) cfg = Conf(filename=cmdline.file, debug=debug)
uc = Userconfig(cfg) uc = Userconfig(cfg)
cfg.debug.stdout(f"Verbose level is {cfg.debug.get_verbose()}", 1) cfg.debug.stdout(f"Verbose level is {cfg.debug.get_verbose()}", 1)