Skip to content

Support for PyCharm's console#10

Open
marck0z wants to merge 3 commits intolaysakura:masterfrom
marck0z:master
Open

Support for PyCharm's console#10
marck0z wants to merge 3 commits intolaysakura:masterfrom
marck0z:master

Conversation

@marck0z
Copy link

@marck0z marck0z commented Jun 20, 2016

When using PyCharm's console the output is not colorized, this is because PyCharm uses redirected streams and as a result self.is_tty is always false, forzing the use of StreamHandler.format(self, record) instead of self.colorize(record), even though PyCharms supports ANSI codes fine.

As far as I know, there isn't a way to automatically detect if a stream supports ANSI codes, so I added the flag passthrough to be able to ignore self.is_tty check.

self, stream,

datefmt='%H:%M:%S',
passthrough=False,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name passthrough seems not understandable enough.
How about ignore_tty_check ?

@miohtama
Copy link
Collaborator

Hi!

I took over the project maintenance. Can you add an example how you are using this with PyCharm, so I can test out? I am another PyCharm using fellow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants