From 7a346d6cf132a61415cd55dfe12861688dfa1606 Mon Sep 17 00:00:00 2001 From: Wouter R Date: Fri, 4 Mar 2016 18:12:28 +0100 Subject: [PATCH] Loglite: several new filter directives. --- src/script/README-loglite.md | 4 +++- src/script/loglite.lua | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/script/README-loglite.md b/src/script/README-loglite.md index c20fa4e..508f467 100644 --- a/src/script/README-loglite.md +++ b/src/script/README-loglite.md @@ -54,7 +54,9 @@ The following directives can be associated with a pattern: * A foreground color, one of: black, red, green, yellow, blue, magenta, cyan or white. * A background color, like foreground colors but prefixed with 'b'. +* `bold`, which usually has the effect of rendering a bright variant of the foreground color (note that `bold,black` renders as dark gray). +* `reverse` will reverse fore- and background colors. +* Also available are `blink` and `underscore` but they do currently not work in all terminal programs or might need to be enabled in the preferences. * `_delete` or `_nodelete` to override the active mode specified in the 'options' above. -* Also available are `blink` and `underline` but they do currently not work in all terminal programs. Directives can be combined with ',' (e.g.: `'red,_nodelete'`). Finally, in any filter set, pattern rules are matched from top to bottom, the last one encountered overriding any previous conflicting directive. diff --git a/src/script/loglite.lua b/src/script/loglite.lua index fc3114e..9effc09 100755 --- a/src/script/loglite.lua +++ b/src/script/loglite.lua @@ -18,8 +18,10 @@ FIXME: --Note: overview of ANSI escape codes: http://ascii-table.com/ansi-escape-sequences.php (support varies per terminal/termtype) local ANSI_COLORS = { - ['blink'] = 5, -- no dice on osx/iterm2 - ['underline'] = 24, -- no dice on osx/iterm2 + ['bold'] = 1, + ['underscore'] = 4, + ['blink'] = 5, -- on osx/iterm2, this has to be enabled in preferences + ['reverse'] = 7, ['black'] = 30, ['red'] = 31, ['green'] = 32,