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.

No newline when input

See original GitHub issue

Code example:

while True:
    x = input("type:")
    try:
        do(x)   
    except:
        log.error("error")

STDout:

type: string
type: {log.error}
string
type: {log.error}
string
type: {log.error}
string

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Delgancommented, Oct 1, 2020

So, output seems malformed regardless of the colorize value. 😕

That’s really weird. Sorry, I don’t have many ideas to explain this behavior. Could that be related to one of your Pycharm plugins? Is there any thread involved somewhere? You can use enqueue=False although it should be the default (this options writes logs using a thread and hence could explain the overlapped output).

could not figure out how to change settings for log with handler = 0

It’s not possible, that’s why you have to call logger.remove() before adding your own handler.

0reactions
Delgancommented, Mar 15, 2021

I’m closing this issue because I honestly don’t think the problem is due to Loguru.

If you have other ideas to track down the problem, or can provide more information to further investigate this issue, feel free to reopen this ticket. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Possible to get user input without inserting a new line?
In short: You can't. raw_input() will always echo the text entered by the user, including the trailing newline. That means whatever the user...
Read more >
Python New Line: How to Print WITHOUT Newline in Python
To get the strings to print without a newline, in python2.x you will have to add a comma (,) at the end of...
Read more >
Suppressing the newline character - IBM
When you press <Enter>, a <newline> character is automatically appended to the characters you typed. For certain UNIX applications, you may want to...
Read more >
Python: How to Print Without Newline? - STechies
In Python 3, print() is a function that prints output on different lines, every time you use the function. However, you can avoid...
Read more >
Removing trailing newline character from fgets() Input
So, in this article, we are going to see some methods to remove trailing newline characters from fgets() input. Methods to remove trailing ......
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