Skip to content

Fix logging behaviour#33

Open
hesch wants to merge 3 commits intopsxpaul:mainfrom
hesch:fix-logging-behaviour
Open

Fix logging behaviour#33
hesch wants to merge 3 commits intopsxpaul:mainfrom
hesch:fix-logging-behaviour

Conversation

@hesch
Copy link

@hesch hesch commented Jun 5, 2020

I encountered a bug where the output of the process was not shown on Windows in IntelliJ. The reason for this bug was, that the process is logging lines CRLF line endings. I changed the behaviour of the OutputStreamLogger-Class to handle CRLF, LF and CR line endings.

@hesch
Copy link
Author

hesch commented Jun 10, 2020

@psxpaul Did you have a chance to review this PR? I would love to have this bug fixed in my Gradle build.

@psxpaul
Copy link
Owner

psxpaul commented Apr 13, 2021

Hi @hesch sorry for the long delay. I don't have a windows machine, so I can't duplicate the bug you're seeing in IntelliJ. I did have some concerns around this approach. The unit test implies that any ending \r character would get swallowed. And on Unix machines I wonder if this would replace all \r\n with just \n. That might be desirable for some people, but not others.

val character = b.toChar()
if (character == '\n') {
if (wasCR || character == '\n') {
logger.lifecycle(sb.toString())
Copy link
Owner

Choose a reason for hiding this comment

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

Would it make sense to instead remove any ending \r character here? And maybe only do that if the System.lineSeparator() is \r\n.

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.

2 participants