[Top][All Lists]

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

Re: RFC: "event" logging

From: Rui Guo
Subject: Re: RFC: "event" logging
Date: Tue, 31 Mar 2009 02:29:27 +0000

This perfectly falls into the catalog of the proposed 'event handler'
part of screen scripting support, which is a gsoc idea. I think we can
try it out in the scripting way when the support is done.


On Mon, 2009-03-30 at 18:09 -0400, Paul Hoffman wrote:
> I'd like to add simple logging of important "events" in screen (a new
> window is created, the user switches to another window, the session is
> detached, etc.).  Before I start coding, I'm wondering if anyone else is
> interested in this or has comments.
> Here's a rough cut at documentation additions:
> ----------- >8 ----------- >8 ----------- >8 ----------- >8 -----------
>        -E file
>             turn on automatic event logging to the given file.  See the
>             EVENT LOGGING chapter and the "eventlog" .screenrc command
>             for details.
>        C-a E         Begins/ends event logging.
>        eventlog [on|off]
>        Turn event logging on or off.  Event logging is off by default.
>        eventlogfile filename
>        Specify the file to which events are logged.  A small subset of
>        string escapes may be used in the filename argument to divide
>        event logging among several files:
>        S      session name
>        n      window number
>        d      day number
>        D      day name
>        Y      full year number
>        m      month number
>        M      month name
>        eventlogtstamp [on|off]
>        eventlogtstamp string [string]
>        This command controls the event logfile time-stamp mechanism of
>        screen.  If time-stamps  are  turned  "on" (the default),  screen
>        adds a string containing the current time at the beginning of
>        each line it writes to the event logfile.  The second form is
>        used for customizing the time-stamp string (`%Y-%m-%dT%0c:%s' by
>        %default).  
>        If event logging is turned on (via the -E option or the
>        "eventlog" command), a message will be written to the specified
>        file each time any one of several significant events takes place.
>        The events are logged using the following printf(1) formats:
>        session %s begun
>        session %s detached
>        session %s attached by user %s
>        session %s renamed: %s
>        session %s ended
>        window %d begun: %s
>        window %d unfocused
>        window %d focused
>        window %s renamed: %s
>        window %s ended
>        Each message is preceded by a timestamp in the form
>        YYYY-mm-ddTHH:MM:SS (the "eventlogtstamp" command may be used to
>        turn this off or customize the timestamp format).
> ----------- >8 ----------- >8 ----------- >8 ----------- >8 -----------
> Looking at the code, this doesn't seem to be too hard to add (famous
> last words).  My one worry is that splitting event logging among
> multiple files is too complicated; perhaps it would be best to just log
> everything in a single file.  And there should be a default
> eventlogfile, but I haven't thought that through yet.
> Thanks,
> Paul.

reply via email to

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