Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pidcat.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import subprocess
from subprocess import PIPE

__version__ = '2.0.0'
__version__ = '2.0.1'

LOG_LEVELS = 'VDIWEF'
LOG_LEVELS_MAP = dict([(LOG_LEVELS[i], i) for i in range(len(LOG_LEVELS))])
Expand All @@ -46,6 +46,7 @@
parser.add_argument('-i', '--ignore-tag', dest='ignored_tag', action='append', help='Filter output by ignoring specified tag(s)')
parser.add_argument('-v', '--version', action='version', version='%(prog)s ' + __version__, help='Print the version number and exit')
parser.add_argument('-a', '--all', dest='all', action='store_true', default=False, help='Print all log messages')
parser.add_argument('-n', '--no-color', dest='no_color', action='store_true', default=False, help='Do not use colorful output')

args = parser.parse_args()
min_level = LOG_LEVELS_MAP[args.min_level.upper()]
Expand Down Expand Up @@ -97,7 +98,10 @@ def termcolor(fg=None, bg=None):
return '\033[%sm' % ';'.join(codes) if codes else ''

def colorize(message, fg=None, bg=None):
return termcolor(fg, bg) + message + RESET
if args.no_color:
return message
else:
return termcolor(fg, bg) + message + RESET

def indent_wrap(message):
if width == -1:
Expand Down
1 change: 1 addition & 0 deletions zsh-completion/_pidcat
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ _pidcat() {
'-v[Print the version number and exit]' \
'-l[Minimum level to be displayed]: :_pidcat_log_levels' \
'-a[Print all log messages]' \
'-n[Do not use colorful output]' \
'--color-gc[Color garbage collection]' \
'--always-display-tags[Always display the tag name]' \
'--current[Filter logcat by current running app]' \
Expand Down