Closed nefarius closed 4 months ago
👍🏻 adding colors. There are some great JS libs for this which should make it fairly straightforward.
Can you recommend any in particular?
Maybe this one? https://github.com/drudru/ansi_up
I just published a new version (0.1.5) that adds support for ANSI color codes. To maintain the visual connection to the container color, lines that have ANSI codes will get prefaced with a color-coded dot. Check it out and let me know what you think:
helm repo update kubetail
helm upgrade kubetail kubetail/kubetail --namespace kubetail
Hm, just tested it, do I need to change some setting or similar, it is not happy about what my services spit out:
Update went through:
helm ls -a -n kubetail
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
kubetail kubetail 7 2024-02-20 12:07:00.3693052 +0100 CET deployed kubetail-0.2.3 0.1.5
Hmm... sorry about that. You shouldn't have to change anything. It looks like it detected ANSI but the HTML conversion didn't go through properly. Can you send me a (sanitized) example of one of your original log lines? I'll do more testing on my end too.
I've attached an anonymized log snippet produced via:
kubectl logs -lapp=my-deployment --all-containers=true | Out-File -Encoding utf8 -FilePath d:\colored-logs.txt
So I hope it got preserved as kubetail would receive it as well: colored-logs.txt
Thanks! The encoding was preserved. Will take a look.
Ok, just pushed a new version with a bug fix (0.1.6). Here's an example on the demo site: https://demo.kubetail.com/console?source=deployments%2Fkubetail-demo%2Floggen-ansi
Let me know if that fixes the problem.
Well, partial good news! We have readable text back, however now no colors at all 😅 Guess this is not how it's supposed to be?
Sorry for that extra noise added by extensions; I also tried it in a private window with no extensions so nothing is interfering.
EDIT: fresh Firefox Portable also color-less.
The latest release (0.1.7) should help but there's still work to be done. I switched to the ansi_up
package which supports more ANSI codes but it assumes a dark background so for now I made the background of the message column dark when ANSI encodings are found:
https://demo.kubetail.com/console?source=deployments%2Fkubetail-demo%2Floggen-ansi
Let me know if the ANSI encodings are being handled correctly on your end. I'll create another issue to track further improvements to ANSI handling.
Yes! Looks exactly like on the terminal now, great work, thanks a ton!
For example this is how it gets interpreted in Windows Terminal: