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.

custom logging level for numba internals.

See original GitHub issue

Numba could do with a custom logging level to use internally so that developers of numba can switch on logging but it doesn’t impact consumers of numba with e.g. logging.DEBUG enabled.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
HPLegioncommented, Aug 6, 2021

I just stumbled over this issue and recalled there was a discussion about this on Gitter last year, so I thought I’d just cross link that here: https://gitter.im/numba/numba?at=5ed533094c9b0f060d39ada5

For what it’s worth: Personally I am not convinced that custom loglevels are the proper way to screen users of numba from log messages. To me, using the abilities of the logging module as suggested by @ugm2 or the filter suggested in the Gitter chat feel more like the solution intended by the devs of the logging module. I think custom levels should only be used if there is a feeling that numba itself needs more fine grain control over its own log messages.

1reaction
tobiasraabecommented, Jul 28, 2020

Hi, I am having an issue with Numba for some time now. Whenever I run pytest and some test fails, Numba produces an unwieldy amount of logging information. Here is a tiny sample:

DEBUG    numba.core.ssa:ssa.py:178 Running <numba.core.ssa._GatherDefsHandler object at 0x0000025067900160>
DEBUG    numba.core.ssa:ssa.py:180 on stmt: $60load_global.0 = global(AssertionError: <class 'AssertionError'>)
DEBUG    numba.core.ssa:ssa.py:180 on stmt: $const62.1 = const(str, internal dict error during lookup)
DEBUG    numba.core.ssa:ssa.py:180 on stmt: $64call_function.2 = call $60load_global.0($const62.1, func=$60load_global.0, args=[Var($const62.1, dictobject.py:735)], kws=(), vararg=None)
DEBUG    numba.core.ssa:ssa.py:180 on stmt: <static> raise <class 'AssertionError'>('internal dict error during lookup')
DEBUG    numba.core.ssa:ssa.py:149 ==== SSA block analysis pass on 70
DEBUG    numba.core.ssa:ssa.py:178 Running <numba.core.ssa._GatherDefsHandler object at 0x0000025067900160>
DEBUG    numba.core.ssa:ssa.py:180 on stmt: $70load_global.0 = global(_nonoptional: <intrinsic _nonoptional>)
DEBUG    numba.core.ssa:ssa.py:180 on stmt: $74call_function.2 = call $70load_global.0(val, func=$70load_global.0, args=[Var(val, dictobject.py:731)], kws=(), vararg=None)
DEBUG    numba.core.ssa:ssa.py:180 on stmt: $76return_value.3 = cast(value=$74call_function.2)
DEBUG    numba.core.ssa:ssa.py:180 on stmt: return $76return_value.3
DEBUG    numba.core.ssa:ssa.py:141 defs defaultdict(<class 'list'>,

Is this related to this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add a custom loglevel to Python's logging facility
The new level needs to be added as an attribute to logging itself for consistency: logging.TRACE = logging.DEBUG - 5 . A method...
Read more >
Logging Level Recommendations for the SSIS Catalog
Notice it's also possible to create your own custom logging levels, where you choose the events and statistics to be logged.
Read more >
Python Logging Levels Explained - LogicMonitor
Python has six log levels with each one assigned a specific integer ... logging to a file is the ability to create a...
Read more >
Python Logging: In-Depth Tutorial - Toptal
Python Logger · Propagate: Decides whether a log should be propagated to the logger's parent. By default, its value is True. · A...
Read more >
Python Logging Guide - Best Practices and Hands-on Examples
So, an unnamed custom logging level with numeric value n appears as ... on cfg:// prefix to refer to objects internal to a...
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