mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
print all logs to stderr
This commit is contained in:
parent
dd3044753c
commit
804bb68ae3
@ -11,7 +11,7 @@ handlers:
|
|||||||
console:
|
console:
|
||||||
level: DEBUG
|
level: DEBUG
|
||||||
class: logging.StreamHandler
|
class: logging.StreamHandler
|
||||||
stream: ext://sys.stdout
|
stream: ext://sys.stderr
|
||||||
formatter: console
|
formatter: console
|
||||||
|
|
||||||
root:
|
root:
|
||||||
|
|||||||
@ -126,11 +126,11 @@ def init(
|
|||||||
add_help=add_help,
|
add_help=add_help,
|
||||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||||
)
|
)
|
||||||
parser.add_argument("-c", "--config", dest="config_path", default="/etc/kvmd/main.yaml", type=valid_abs_file,
|
parser.add_argument("-c", "--config", default="/etc/kvmd/main.yaml", type=valid_abs_file,
|
||||||
help="Set config file path", metavar="<file>")
|
help="Set config file path", metavar="<file>")
|
||||||
parser.add_argument("-o", "--set-options", dest="set_options", default=[], nargs="+",
|
parser.add_argument("-o", "--set-options", default=[], nargs="+",
|
||||||
help="Override config options list (like sec/sub/opt=value)", metavar="<k=v>",)
|
help="Override config options list (like sec/sub/opt=value)", metavar="<k=v>",)
|
||||||
parser.add_argument("-m", "--dump-config", dest="dump_config", action="store_true",
|
parser.add_argument("-m", "--dump-config", action="store_true",
|
||||||
help="View current configuration (include all overrides)")
|
help="View current configuration (include all overrides)")
|
||||||
if check_run:
|
if check_run:
|
||||||
parser.add_argument("--run", dest="run", action="store_true",
|
parser.add_argument("--run", dest="run", action="store_true",
|
||||||
@ -139,7 +139,7 @@ def init(
|
|||||||
|
|
||||||
if options.dump_config:
|
if options.dump_config:
|
||||||
_dump_config(_init_config(
|
_dump_config(_init_config(
|
||||||
config_path=options.config_path,
|
config_path=options.config,
|
||||||
override_options=options.set_options,
|
override_options=options.set_options,
|
||||||
load_auth=True,
|
load_auth=True,
|
||||||
load_hid=True,
|
load_hid=True,
|
||||||
@ -148,7 +148,7 @@ def init(
|
|||||||
load_gpio=True,
|
load_gpio=True,
|
||||||
))
|
))
|
||||||
raise SystemExit()
|
raise SystemExit()
|
||||||
config = _init_config(options.config_path, options.set_options, **load)
|
config = _init_config(options.config, options.set_options, **load)
|
||||||
|
|
||||||
logging.captureWarnings(True)
|
logging.captureWarnings(True)
|
||||||
logging.config.dictConfig(config.logging)
|
logging.config.dictConfig(config.logging)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user