Skip to content

Instantly share code, notes, and snippets.

@nabeelio
Last active August 29, 2015 14:24
Show Gist options
  • Save nabeelio/10e0047123d5ebc2f0dd to your computer and use it in GitHub Desktop.
Save nabeelio/10e0047123d5ebc2f0dd to your computer and use it in GitHub Desktop.
multitail
#!/usr/bin/env python
import sys
import random
import argparse
from fabric.operations import local
COLORS = ['green', 'blue', 'yellow', 'red']
CMD = ['multitail -mb 10MB --follow-all -n 100']
parser = argparse.ArgumentParser()
parser.add_argument('-m', action='store_true', default=False,
help='merge all logs into single output')
parser.add_argument('files', nargs='*')
args = parser.parse_args()
sys.argv.pop(0)
for file in args.files:
color = random.choice(COLORS)
CMD.append('-ci %s ' % color)
if len(CMD) > 1 and args.m:
CMD.append('-I')
CMD.append(file)
CMD = ' '.join(CMD)
local(CMD)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment