screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: using screen logs


From: Jae Norment
Subject: RE: using screen logs
Date: Tue, 3 Feb 2009 09:36:01 -0600

I fairly pretty uncomfortable running any of the solutions presented
here:  I know enough about C/C++ to know that it's pretty easy to write
code that can be pretty destructive to an instance of an operating
system.  The last thing I want to do is bring down the production
servers that I'm maintaining that are important enough to make activity
logs with a program designed to make the logs readable...

I ended up cobbling something together with Python.  Thanks to the
suggestions from Micah Cowan and Will Stevenson, I had source code to
look at while cobbling...

It's not perfect, by any means.  I lose the meaning of anything that
happens from inside a text editor.  I should probably get in the habit
of cat'ing the files I change, before and after the changes made, so
that the changes are included in the maintenance logs... ... but it's
good enough that I can usually read most of what happens, and the
original isn't destroyed in the process, so I always have that, too...



-----Original Message-----
From: Micah Cowan [mailto:address@hidden 
Sent: Friday, January 30, 2009 3:24 AM
To: Jae Norment
Cc: address@hidden
Subject: Re: using screen logs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jae Norment wrote:
> I use screen to log sessions where I patch Debian servers.  Screen
> captures ANSI control codes (like positioning and color changes),
which
> is probably appropriate, however, I want a version of the logs without
> those codes so that I can open it in a text editor.  I've been told
that
> a little perl could help, been directed to 'script', both of which
don't
> seem to do the trick that I want.  For the perl solution, I need to
know
> too much about the ANSI codes that I want to replace.  Script just
> dumps... there doesn't seem to be a good way to capture without the
> codes...
> 
> Screen is a widely used application, and my use to generate logs of my
> sessions has got to be a fairly popular function of screen... so what
is
> everyone else using to make the logs human readable?  ( Ideally, I'd
> like something that will reformat the log either to a file or to a
pipe.
> )

I think you can use my Teseq program for this. I was going to give it a
"strip" option, but haven't yet. In the meantime, you could do:

  teseq -DLE screenlog.0 | reseq - -

You can get teseq from ftp.gnu.org/gnu/teseq/.

This has the advantage of stripping out entire escape sequences, where
stripping out only control characters would leave the printable majority
from sequences like \E[31;1m. However, it would still leave
non-escape-sequence control characters in (the main one you'd need to
worry about is probably backspace), so you might want to additionally
pipe it through that sed script that was recommended (after
teseq/reseq).

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer.
GNU Maintainer: wget, screen, teseq
http://micah.cowan.name/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmCxy8ACgkQ7M8hyUobTrFgZQCeLFOlnmJ8KgG7sKvAy5LSIOsR
AnYAmgMXaR+gR06zHF5TyFORiB+FmFDQ
=KdlU
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]