Skip to content

Instantly share code, notes, and snippets.

@kristm
Last active December 23, 2022 00:00
Show Gist options
  • Save kristm/2fce3cfb073cef20dfaa9804431b7f21 to your computer and use it in GitHub Desktop.
Save kristm/2fce3cfb073cef20dfaa9804431b7f21 to your computer and use it in GitHub Desktop.
tailf
#!/bin/bash
tail -f $1 | awk '/INFO/ {print "\033[32m" $0 "\033[39m"}
/SEVERE/ {print "\033[5m\033[31m\033[40m" $0 "\033[39m"}
/kernel|lsd/ {print "\033[36m" $0 "\033[39m"}
/login|(a|A)uth|accountsd|secd/ {print "\033[46m\033[34m" $0 "\033[39m"}
/networkd|sharingd|blued|watchdogd|cdpd|locationd/ {print "\033[92m" $0 "\033[39m"}
/imagent/ {print "\033[7m\033[92m" $0 "\033[39m"}
/Google/ {print "\033[43m\033[90m" $0 "\033[39m"}
/Error|spindump/ {print "\033[101m\033[30m" $0 "\033[39m"}
/AirPlay|AirPort/ {print "\033[0m\033[45m\033[97m" $0 "\033[39m"}
/WindowServer/ {print "\033[2m\033[100m\033[30m" $0 "\033[39m"}
/CGXDisplayDidReconfigure/ {print "\033[41m" $0 "\033[39m"}
/(T|t)hermal/ {print "\033[97m" $0 "\033[39m"}
/CommCenter/ {print "\033[7m\033[97m" $0 "\033[39m"}
{ print "\033[0m\033[90m\033[40m" $0 "\033[39m" }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment