Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flush logging buffer before printing CompileDaemon output #16

Open
evanpurkhiser opened this issue Mar 10, 2016 · 2 comments
Open

Flush logging buffer before printing CompileDaemon output #16

evanpurkhiser opened this issue Mar 10, 2016 · 2 comments

Comments

@evanpurkhiser
Copy link

Since the logger buffer isn't flushed until another newline is found it's possible that the output that CompileDaemon generates can be affected by ANSII escape sequences that haven't been terminated due to no newline being printed.

For example, a program that writes output with color, writes a newline, then immediately writes the color reset escape sequence. Because the output is buffered the reset escape sequence won't be written until a newline is outputted. However, if the program is terminated and restarted it will never write the reset escape sequence and the output from CompileDaemon (eg "Running build command!") will be affected by the previous escape sequence.

Obviously this could be fixed by outputting the reset sequence before writing a newline, but it seems like the 'correct' solution would be for this software to flush the buffer when a program is recompiled.

@githubnemo
Copy link
Owner

package main
import "fmt"

func main() {
    fmt.Println(string(27) + "[31mColored.");
    fmt.Print(string(27) + "[0m");
}

Is this your test case?

@evanpurkhiser
Copy link
Author

Correct.

image

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

No branches or pull requests

2 participants