[BUG] log formating wrapping line numbers
See original GitHub issueDescribe the bug
When printing with either Console().log()
or using the RichHandler()
logging handler line numbers are warped and printed on the next line, see below:
To Reproduce
import logging
from rich.logging import RichHandler
from rich.console import Console
logging.basicConfig(level=logging.DEBUG, handlers=[RichHandler()])
logging.error('test')
logging.warning('test')
logging.info('test')
logging.debug('test')
Console().log('test')
Platform The test report is using a the debian:buster image after running the following commands
root@6e16bf7eb9df:/# apt-get update
root@6e16bf7eb9df:/# apt-get install python3 python3-pip vim
root@6e16bf7eb9df:/# pip3 install rich
root@6e16bf7eb9df:/# python3 --version
Python 3.7.3
root@6e16bf7eb9df:/# pip3 list | grep rich
rich 9.11.0
root@6e16bf7eb9df:/# uname -a
Linux 6e16bf7eb9df 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 GNU/Linux
Diagnose I may ask you to cut and paste the output of the following commands. It may save some time if you do it now.
python -m rich.diagnose python -m rich._windows pip freeze | grep rich
root@6e16bf7eb9df:/# python3 -m rich.diagnose
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ <class 'rich.console.Console'> โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ A high level console interface. โ
โ โ
โ โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โ
โ โ <console width=158 ColorSystem.STANDARD> โ โ
โ โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ โ
โ โ
โ color_system = 'standard' โ
โ encoding = 'utf-8' โ
โ file = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'> โ
โ height = 16 โ
โ is_dumb_terminal = False โ
โ is_interactive = True โ
โ is_jupyter = False โ
โ is_terminal = True โ
โ legacy_windows = False โ
โ no_color = False โ
โ options = ConsoleOptions(size=ConsoleDimensions(width=158, height=16), legacy_windows=False, min_width=1, max_width=158, is_terminal=True, โ
โ encoding='utf-8', justify=None, overflow=None, no_wrap=False, highlight=None, height=None) โ
โ quiet = False โ
โ record = False โ
โ safe_box = True โ
โ size = ConsoleDimensions(width=158, height=16) โ
โ soft_wrap = False โ
โ stderr = False โ
โ style = None โ
โ tab_size = 8 โ
โ width = 158 โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
root@6e16bf7eb9df:/# python3 -m rich._windows
platform="Linux"
WindowsConsoleFeatures(vt=False, truecolor=False)
root@6e16bf7eb9df:/# pip3 freeze | grep rich
rich==9.11.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
[BUG] log formating wrapping line numbers #1019 - GitHub
Describe the bug When printing with either Console().log() or using the RichHandler() logging handler line numbers are warped and printed onย ...
Read more >A proper wrapper for console.log with correct line number?
I would like to wrap console.log for more convenient usage. //isDebug controls the entire site. var isDebug = true; //debugย ...
Read more >Long line wrapping in Nano - Unix & Linux Stack Exchange
To see the word wrapping style you described, use nano's "soft wrapping": Esc + $ . The Esc + L command you (and...
Read more >Code macro should wrap long lines | Confluence Server ... - Jira
The wrap up of the long lines caused a problem with a mismatch between the line numbers and the actual line. To solve...
Read more >[misc] Text Viewer and Editor needs to support word wrap - Bugs
Hello Daniel, Terminology : - Line Wrapping : Word Wrap in the Eclipse jargon. - Context menu : Menu that pops up when...
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
I think Rich may not be respecting the COLUMNS env var. Iโll have a fix in the next minor version.
Itโs a bug in your terminal software Iโm afraid. You could try raising an issue with that project.