cli: add a --log-level option

pull/19/head
Konstantin Baierer 4 years ago
parent ca23b32e9b
commit 70d0b985a9

@ -1,5 +1,5 @@
import click import click
from ocrd_utils import initLogging from ocrd_utils import initLogging, setOverrideLogLevel
from sbb_newspapers_org_image.eynollah import eynollah from sbb_newspapers_org_image.eynollah import eynollah
@ -84,6 +84,12 @@ from sbb_newspapers_org_image.eynollah import eynollah
is_flag=True, is_flag=True,
help="if this parameter set to true, this tool would ignore headers role in reading order", help="if this parameter set to true, this tool would ignore headers role in reading order",
) )
@click.option(
"--log-level",
"-l",
type=click.Choice(['OFF', 'DEBUG', 'INFO', 'WARN', 'ERROR']),
help="Override log level globally to this",
)
def main( def main(
image, image,
out, out,
@ -98,7 +104,10 @@ def main(
full_layout, full_layout,
allow_scaling, allow_scaling,
headers_off, headers_off,
log_level
): ):
if log_level:
setOverrideLogLevel(log_level)
initLogging() initLogging()
eynollah( eynollah(
image, image,

Loading…
Cancel
Save