Skip to content

Instantly share code, notes, and snippets.

@alexhayes
Last active September 8, 2021 08:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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
@qharlie
Copy link

qharlie commented Jul 28, 2021

Perfect ty

@lnlrbr
Copy link

lnlrbr commented Aug 23, 2021

Great! ty

@granitba
Copy link

granitba commented Sep 6, 2021

Very useful, though I would personally have the timestamps be color neutral and also color exception tracebacks somehow. I will upload my file if I manage to do it.

@qharlie
Copy link

qharlie commented Sep 7, 2021

Cool thx @granitba , Id personally like highlighted "stuff between quotes" I'll see if I can manage that and upload here if so.

@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