question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CLI log-level ignored if config file is present

See original GitHub issue

It seems we were not thorough enough in #599: Currently --log-level has no effect when some ~/ocrd_logging.conf is present.

IIUC this is because ocrd_utils.logging.initLogging comes after setOverrideLoglevel (so all its logger setLevels get wiped out and only global _overrideLogLevel survives), but logging.config.fileConfig of course does not honour ocrd_utils.logging.getLogger’s _overrideLogLevel.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
bertskycommented, Oct 20, 2020

@M3ssman

Actually, the logging module by itself behaves as expected even if the config file is present:

Your test is not realistic though. On the CLI, the decorator for --log-level kicks in before initLogging – see above.

@kba

[loggers]
keys=root

Your are missing keys=root,ocrd to arm that additional logger!

1reaction
M3ssmancommented, Oct 19, 2020

I’m totally aware of stuff like this is hard to catch, but I really like to see a test-fixture setup for this situation that can be integrated into test_logging.py even as a sort of regression test and, as first step, to reproduce the mentioned behavior.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CLI - Prettier
This command formats all files supported by Prettier in the current directory ... If a config file is found will evaluate it and...
Read more >
Command line options - Envoy Proxy
Envoy is driven both by a JSON configuration file as well as a set of command line options. The following are the command...
Read more >
config | npm Docs
Run npm config ls -l to see a set of configuration parameters that are internal to npm, and are defaults if nothing else...
Read more >
Main configuration file — WirePlumber 0.4.13 documentation
The format of this configuration file is the variant of JSON that is also used in PipeWire ... the module is ignored when...
Read more >
Configuring Logging - Quarkus
The default minimum log level for every log category. If no level configuration exists for a given logger category, the enclosing (parent) category...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found