DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T V

⟦2ccc8c2a6⟧ TextFile

    Length: 3552 (0xde0)
    Types: TextFile
    Names: »V«

Derivation

└─⟦5f3412b64⟧ Bits:30000745 8mm tape, Rational 1000, ENVIRONMENT 12_6_5 TOOLS 
    └─ ⟦91c658230⟧ »DATA« 
        └─⟦458657fb6⟧ 
            └─⟦a5bbbb819⟧ 
                └─⟦this⟧ 
└─⟦d10a02448⟧ Bits:30000409 8mm tape, Rational 1000, ENVIRONMENT, D_12_7_3
    └─ ⟦fc9b38f02⟧ »DATA« 
        └─⟦9b46a407a⟧ 
            └─⟦eec0a994f⟧ 
                └─⟦this⟧ 

TextFile

with Calendar;
with Time_Utilities;
with Simple_Status;
package Log_Reader is

-- Abstraction for reading the system error log.
--
-- Provides an Iterator that automatically crosses log files and also
-- extends into the current active error log.  Thus, log messages
-- can be read right up to the last one issued by the system.
--
-- The date part of the date/time for an entry is impossible to know for
-- the first few entries in the first available log file.  In this case,
-- 1/1/1901 is returned (or 1/2/1901, if midnight occurs in these few
-- date unknown entries).
--
-- Continuation lines are automatically incorporated into each entry so that
-- each call to Next moves to a complete new entry.  Continuation lines
-- are read as part of the Message field and are preceded by ASCII.lf
-- characters.
--
-- NOTE: This package makes an assumption about the Error Log files
-- that it processes.  It assumes that the log file names are in the
-- form of Log_YY_MM_DD_At_HH_MM_SS, this is the form that the error log
-- daemon creates file names as in the directory !Machine.Error_Logs,
-- and that the time embedded in the file name accurately represents the
-- times of the entries in the file.


    procedure Load_Logs (From_Directory : String := "!machine.error_logs");

    procedure Load_Logs (Start_Time : Calendar.Time;
                         Stop_Time : Calendar.Time;
                         From_Directory : String := "!machine.error_logs");

    -- Initialize the module.  Must be called before any other operations.
    -- Builds map of log files in the specified directory.  Specifying a
    -- start and stop time will reduce the number of log files examined to
    -- those created during the given period.  Otherwise, all log files in
    -- the given directory are examined.
    --
    -- NOTE: The Start_Time and Stop_Time entered by this procedure are
    -- used as the start date and stop date.  This means that the time
    -- part of the Calendar.Time variable is ignored.  This package will
    -- iterate over the log entries from 00:00:01 of the start date to
    -- 23:59:59 of the stop date (or as much as is available in the log
    -- files and the current day's log messages).

    type Iterator is private;
    procedure Initialize (I : out Iterator;
                          Status : in out Simple_Status.Condition);

    procedure Next (I : in out Iterator;
                    Status : in out Simple_Status.Condition);


    function Done (I : Iterator) return Boolean;
    function Current_Entry (I : Iterator) return String;
    function Current_Time (I : Iterator) return Time_Utilities.Time;
    function Current_Severity (I : Iterator) return String;
    function Current_Client (I : Iterator) return String;
    function Current_Condition (I : Iterator) return String;
    function Current_Message (I : Iterator) return String;
    function Current_File (I : Iterator) return String;

    function Get_Time (Log_Entry : String) return Time_Utilities.Time;
    -- Note that only the HH:MM:SS part of the time is set by this operation
    function Severity (Log_Entry : String) return String;
    function Client (Log_Entry : String) return String;
    function Condition (Log_Entry : String) return String;
    function Message (Log_Entry : String) return String;

    function Number_Of_Log_Files return Natural;
    -- Returns number of log files that exist.  Defined only after call
    -- to Load_Logs.
private

    type Iterator_Data;
    type Iterator is access Iterator_Data;

end Log_Reader;