Skip to content

Instantly share code, notes, and snippets.

@alexhayes
Last active September 8, 2021 08:57
Show Gist options
  • Save alexhayes/70d22da4c6ca71138273 to your computer and use it in GitHub Desktop.
Save alexhayes/70d22da4c6ca71138273 to your computer and use it in GitHub Desktop.
multitail python log formatting
colorscheme:python-log
cs_re_s:blue:[DEBUG|INFO|WARNING|CRITICAL|ERROR] ([a-z\.0-9\_]+):
cs_re_s:white,magenta,bold:(\sDEBUG\s)
cs_re:magenta:.*DEBUG.*
cs_re_s:white,green,bold:(\sINFO\s)
cs_re:green:.*INFO.*
cs_re_s:white,yellow,bold:(\sWARNING\s)
cs_re:yellow:.*WARNING.*
cs_re_s:white,red,bold:(\sCRITICAL\s)
cs_re:red:.*CRITICAL.*
cs_re_s:white,red,bold:(\sERROR\s)
cs_re:red:.*ERROR.*

README

Place the .multitailrc in your home directory and then you can do the following;

multitail -f -cS python-log /path/to/my/python.log
@granitba
Copy link

granitba commented Sep 8, 2021

I made the timestamps color neutral by doing this: changing this "cs_re:green:.INFO." into this "cs_re:green:INFO.", removing the .
I can't get tracebacks to be colored in any meaningful way, so I'll leave it at that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment