Logging level should be logging.NOTSET
See original GitHub issue
332 | # instead of `logger.debug` outside of this function becomes an
-- | --
333 | # error.
334 |
335 | if verbose:
336 | logging.basicConfig(format="%(levelname)s %(message)s", level=logging.DEBUG)
Calling basicConfig
is unfriendly to other Python code that wants to use the logging as it cannot be called twice. If it must be called I think it should be called with logging.NOTSET
I bring this up because I have a custom log level set to 5 and I cannot see it.
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (20 by maintainers)
Top Results From Across the Web
About NOTSET in python logging - Stack Overflow
When a logger is created, the level is set to NOTSET (which causes all messages to be processed when the logger is the...
Read more >Python Logging Levels Explained - LogicMonitor
Log levels relate to the “importance” of the log. For example, an “error” log is a top priority and should be considered more...
Read more >logging — Logging facility for Python — Python 3.11.1 ...
Logging messages which are less severe than level will be ignored; ... logger has a level of NOTSET, its chain of ancestor loggers...
Read more >Python Logging: In-Depth Tutorial - Toptal
When a logger decides whether a log should pass according to the level check (e.g., if the log level is lower than logger...
Read more >Python Logging Guide: The Basics - CrowdStrike
Notset, 0, Default level when a new logger is created. Setting the root logger to NOTSET logs all messages. For other loggers, NOTSET...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The problem is
utils.get_sim_time()
is called to inject the current time into the log message, which callssimulator.get_sim_time()
, which raises theRuntimeError
.@eric-wieser Calling
default_config
calls into the simulator. https://github.com/cocotb/cocotb/blob/26304cfc5fc9adbf567f2929910d5b6b9f414331/cocotb/log.py#L109-L110