Closed mgale closed 1 year ago
Hey @mgale do you mind providing an example of how you used the changes in this PR so we can test? Thank you!
Hey @mgale do you mind providing an example of how you used the changes in this PR so we can test? Thank you!
Hello @bashbunni sorry for this drive by PR, also I should have added tests.
I tried adding tests on my own but things only work correctly when I execute the tests from the command line using go test. If I try executing the tests via vscode the colour output is always disabled.
How I am using this functionality...
I created an events file:
f, err := os.OpenFile(ltEventLog, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)
...
eventLogger := log.NewWithOptions(f, log.Options{ReportTimestamp: true, ForceColors: true})
eventLogger.Info(...)
Then I have a separate go routine that is using tail.TailFile, reads lines from the file and updates the view by doing a p.Send() method on a tea.Program.
Hi @mgale, could you try this PR? It takes a simpler approach to force the color output https://github.com/charmbracelet/log/pull/69
Hi @mgale, could you try this PR? It takes a simpler approach to force the color output #69
Hello, FYI I am on vacation for the month of August however I managed to give this a quick test and it worked for me. Thank you.
Closing PR in favor of: https://github.com/charmbracelet/log/pull/69
I used this workflow when using io.Pipe, allowing me to redirect the logging output to a viewport.