mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-06-10 04:39:54 +02:00
cli: add a --log-level option
This commit is contained in:
parent
ca23b32e9b
commit
70d0b985a9
1 changed files with 10 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue