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.

Unexpected logging outputs after setting log level to debug.

See original GitHub issue

I got unexcepted outputs to console after set log level to debug while using tab to autocomplete, and it breaks my typing. Here’s my screenshot: ipython-logging

Reproduce:

In [1]: import logging

In [2]: logging.getLogger().setLevel(logging.DEBUG)

In [3]: logging.info("xxxx")
INFO:root:xxxx

In [4]: logging.<TAB>DEBUG:parso.python.diff:diff parser start
DEBUG:parso.python.diff:diff parser calculated
DEBUG:parso.python.diff:diff: line_lengths old: 1, new: 1
DEBUG:parso.python.diff:diff replace old[1:1] new[1:1]
DEBUG:parso.python.diff:parse_part from 1 to 1 (to 0 in part parser)
DEBUG:parso.python.diff:diff parser end
DEBUG:parso.cache:pickle loaded: /Users/uushuo/.pyenv/versions/3.6.3/lib/python3.6/collections/__init__.py
DEBUG:parso.cache:pickle loaded: /Users/uushuo/.pyenv/versions/3.6.3/lib/python3.6/io.py
DEBUG:parso.cache:pickle loaded: /Users/uushuo/.pyenv/versions/3.6.3/lib/python3.6/os.py
DEBUG:parso.cache:pickle loaded: /Users/uushuo/.pyenv/versions/3.6.3/lib/python3.6/string.py
DEBUG:parso.cache:pickle loaded: /Users/uushuo/.pyenv/versions/3.6.3/lib/python3.6/threading.py
DEBUG:parso.cache:pickle loaded: /Users/uushuo/.pyenv/versions/3.6.3/lib/python3.6/traceback.py
DEBUG:parso.cache:pickle loaded: /Users/uushuo/.pyenv/versions/3.6.3/lib/python3.6/warnings.py
DEBUG:parso.cache:pickle loaded: /Users/uushuo/.pyenv/versions/3.6.3/lib/python3.6/weakref.py

Version info

{'commit_hash': 'ca5443062',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/Users/uushuo/.pyenv/versions/3.6.3/envs/next/lib/python3.6/site-packages/IPython',
 'ipython_version': '6.2.1',
 'os_name': 'posix',
 'platform': 'Darwin-17.0.0-x86_64-i386-64bit',
 'sys_executable': '/Users/uushuo/.pyenv/versions/next/bin/python',
 'sys_platform': 'darwin',
 'sys_version': '3.6.3 (default, Dec 15 2017, 20:17:37) \n'
                '[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]'}

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:41
  • Comments:29

github_iconTop GitHub Comments

45reactions
vgavrocommented, Dec 29, 2017

First of all, you should update to parso 0.1.1 in case you’re receiving this messages in ROOT level (like I did). This is related to https://github.com/davidhalter/parso/issues/9 But seems from your logs you have parso 0.1.1 already. Second, this should fix this:

logging.getLogger('parso.python.diff').disabled = True
22reactions
armenak-baburyancommented, Dec 6, 2018

The issue came back with ipython 7.2

Read more comments on GitHub >

github_iconTop Results From Across the Web

logging - Unexpected python logger output when using ...
In line 5th code line I can go for logger.setLevel(l.CRITICAL) or logger.setLevel(l.DEBUG) . Both results are unsatisfying. With logger.
Read more >
Unexpected logging outputs after setting log level to debug.
I got unexcepted outputs to console after set log level to debug while using tab to autocomplete, and it breaks my typing.
Read more >
Log Levels Explained and How to Use Them - Better Stack
Log levels are labels that indicate the severity or urgency of a log entry. Their primary purpose is to separate messages that are...
Read more >
Logging HOWTO — Python 3.11.1 documentation
The logging functions are named after the level or severity of the events they are ... DEBUG:root:This message should go to the log...
Read more >
Logging Levels: What They Are & How to Choose Them
A log level used for events considered to be useful during software debugging when more granular information is needed. Trace, A log level...
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