kubecolor icon indicating copy to clipboard operation
kubecolor copied to clipboard

Feature: colorize logs

Open applejag opened this issue 5 months ago • 3 comments

Expected Behavior

Would be grand if kubecolor could do some simple colorizing of log lines when doing kubecolor logs my-pod-123.

Could be a lot of simple colorizing techniques, such as highlighting ERROR, ERR, and ERRO as bold red. Have WARNING, WRN, and WARN as orange/dark yellow, and so on.

As well as colorizing quotations "text" or stuff inside square brackets [text] to make them stand out more.

It's not a perfect solution, but it could help find some keywords in logs.

Then if the log line is a JSON or logfmt message, then apply syntax highlighting there as well. Such as in JSON to highlight the key vs value parts.

Also think timestamps should be grayed out, like using "bright black" in basic ANSI terminal coloring terms.

Current Behavior

Logs are just green.

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Operating System: Linux
  • kubectl version:
  • kubecolor version: v0.2.2

applejag avatar Jan 26 '24 14:01 applejag