FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 11-24-2008, 12:14 PM
"Rob Gom"
 
Default Colored less

Hi,
do you know any colored less version? I often browse logs (not Linux
system logs). I use less for that and it works fine. However it is
single colored. I know that less has ANSI sequences support, but for
that I would have to change program output (which is not possible).
The only solution which I see is run sed producing ANSI sequences as
LESSPIPE. Do you know any other solution?
In other words: I have text file. It can be big (few GB). I want to
browse it. I would like to color every line, for example containing
ERROR as RED, containing WARNING as YELLOW, containing [RG].*debug
as GRAY ... I would like to define coloring rules. The viewer can be
text-based (like less) or for any XWindow system.

I would appreciate any comments on that.

Regards,
Robert


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 11-24-2008, 12:44 PM
"Magnus Therning"
 
Default Colored less

On Mon, Nov 24, 2008 at 1:14 PM, Rob Gom <rgom.debian@gmail.com> wrote:
> Hi,
> do you know any colored less version? I often browse logs (not Linux
> system logs). I use less for that and it works fine. However it is
> single colored. I know that less has ANSI sequences support, but for
> that I would have to change program output (which is not possible).
> The only solution which I see is run sed producing ANSI sequences as
> LESSPIPE. Do you know any other solution?
> In other words: I have text file. It can be big (few GB). I want to
> browse it. I would like to color every line, for example containing
> ERROR as RED, containing WARNING as YELLOW, containing [RG].*debug
> as GRAY ... I would like to define coloring rules. The viewer can be
> text-based (like less) or for any XWindow system.
>
> I would appreciate any comments on that.

Switch to using view (basically a read-only vim)

/M

--
Magnus Therning (OpenPGP: 0xAB4DFBA4)
magnusï¼*therning.org Jabber: magnusï¼*therning.org
http://therning.org/magnus identi.ca|twitter: magthe
 
Old 11-24-2008, 12:51 PM
Raj Kiran Grandhi
 
Default Colored less

Rob Gom wrote:

Hi,
do you know any colored less version? I often browse logs (not Linux
system logs). I use less for that and it works fine. However it is
single colored. I know that less has ANSI sequences support, but for
that I would have to change program output (which is not possible).
The only solution which I see is run sed producing ANSI sequences as
LESSPIPE. Do you know any other solution?


Did you try `ccze'? It is in the repos.


In other words: I have text file. It can be big (few GB). I want to
browse it. I would like to color every line, for example containing
ERROR as RED, containing WARNING as YELLOW, containing [RG].*debug
as GRAY ... I would like to define coloring rules. The viewer can be
text-based (like less) or for any XWindow system.

I would appreciate any comments on that.

Regards,
Robert





--

If you can't explain it simply, you don't understand it well enough.
-- Albert Einstein


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 11-24-2008, 01:00 PM
"Rob Gom"
 
Default Colored less

>
> Switch to using view (basically a read-only vim)
>
> /M
>
Thanks for the suggestion. Invoking vim would trigger reading whole
file to memory. I expected the same for view, but for 1,5GB it started
very fast.
However I don't see two things:
1. Automatic file update (when it's changed).
2. Easy way to colorify lines based on regexp.

Regards,
Robert


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 11-24-2008, 01:04 PM
"Rob Gom"
 
Default Colored less

On Mon, Nov 24, 2008 at 2:51 PM, Raj Kiran Grandhi <grajkiran@gmail.com> wrote:
> Rob Gom wrote:
>>
>> Hi,
>> do you know any colored less version? I often browse logs (not Linux
>> system logs). I use less for that and it works fine. However it is
>> single colored. I know that less has ANSI sequences support, but for
>> that I would have to change program output (which is not possible).
>> The only solution which I see is run sed producing ANSI sequences as
>> LESSPIPE. Do you know any other solution?
>
> Did you try `ccze'? It is in the repos.
>
[cut]
How can I use that? As LESSPIPE?
Is it easily configurable?

Regards,
Robert


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 11-24-2008, 01:04 PM
François Cerbelle
 
Default Colored less

Le Lun 24 novembre 2008 15:00, Rob Gom a écrit :
> However I don't see two things:
> 1. Automatic file update (when it's changed).
> 2. Easy way to colorify lines based on regexp.

You might try "swatch"

Fanfan
--
http://www.cerbelle.net - http://www.afdm-idf.org


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 11-24-2008, 01:23 PM
"Magnus Therning"
 
Default Colored less

On Mon, Nov 24, 2008 at 2:00 PM, Rob Gom <rgom.debian@gmail.com> wrote:
>>
>> Switch to using view (basically a read-only vim)
>>
>> /M
>>
> Thanks for the suggestion. Invoking vim would trigger reading whole
> file to memory. I expected the same for view, but for 1,5GB it started
> very fast.
> However I don't see two things:
> 1. Automatic file update (when it's changed).

I'm not sure exactly how it can be done automatically. I didn't even
know less could. Anyway, the command in vim to reread the open file
is ':e!'.

> 2. Easy way to colorify lines based on regexp.

You'll probably have to read up on how to add colour to vim. I'm sure
your favourite search engine can help you out:
http://letmegooglethatforyou.com/?q=vim+coloring :-)

/M

--
Magnus Therning (OpenPGP: 0xAB4DFBA4)
magnusï¼*therning.org Jabber: magnusï¼*therning.org
http://therning.org/magnus identi.ca|twitter: magthe
 
Old 11-24-2008, 05:42 PM
Celejar
 
Default Colored less

On Mon, 24 Nov 2008 15:00:17 +0100
"Rob Gom" <rgom.debian@gmail.com> wrote:

> >
> > Switch to using view (basically a read-only vim)
> >
> > /M
> >
> Thanks for the suggestion. Invoking vim would trigger reading whole
> file to memory. I expected the same for view, but for 1,5GB it started
> very fast.
> However I don't see two things:
> 1. Automatic file update (when it's changed).

less doesn't seem to do this either.

> Robert

Celejar
--
mailmin.sourceforge.net - remote access via secure (OpenPGP) email
ssuds.sourceforge.net - A Simple Sudoku Solver and Generator


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 11-24-2008, 08:22 PM
"Javier Barroso"
 
Default Colored less

On Mon, Nov 24, 2008 at 7:42 PM, Celejar <celejar@gmail.com> wrote:
> On Mon, 24 Nov 2008 15:00:17 +0100
> "Rob Gom" <rgom.debian@gmail.com> wrote:
>

>> However I don't see two things:
>> 1. Automatic file update (when it's changed).
>
> less doesn't seem to do this either.

except for growing files, F key in less emulate 'tail -f' (I don't
known when this feature was introduced in less)


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 06:32 AM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org