Skip to content

Commit

Permalink
Feature : Global ignore list (Issue #79)
Browse files Browse the repository at this point in the history
Ignore list is read from an environment variable named
PIDCAT_IGNORED_TAGS. Multiple tags can be set, separated
by a semicolon.

eg: on *nix systems just type the following in a terminal
$ export PIDCAT_IGNORED_TAGS="art;dalvikvm"
  • Loading branch information
Xavier Gouchet committed Feb 12, 2016
1 parent f818e10 commit 2a00e7d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pidcat.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import argparse
import sys
import re
import os
import subprocess
from subprocess import PIPE

Expand Down Expand Up @@ -128,6 +129,8 @@ def indent_wrap(message):
'DEBUG': YELLOW,
}

ENV_IGNORED_TAGS = os.getenv('PIDCAT_IGNORED_TAGS',"").split(';')

def allocate_color(tag):
# this will allocate a unique format for the given tag
# since we dont have very many colors, we always keep track of the LRU
Expand Down Expand Up @@ -330,7 +333,9 @@ def tag_in_tags_regex(tag, tags):
continue
if args.tag and not tag_in_tags_regex(tag, args.tag):
continue

if tag_in_tags_regex(tag, ENV_IGNORED_TAGS):
continue

linebuf = ''

if args.tag_width > 0:
Expand Down

0 comments on commit 2a00e7d

Please sign in to comment.