DIRECTORY AMTypes USING [ TV ], Commander USING [ Handle ], IO USING [ STREAM, Value ], Rope USING [ ROPE ] ; Log: CEDAR DEFINITIONS = { PD: TYPE = RECORD [ attended: BOOLEAN_FALSE, sysIn: IO.STREAM, sysOut: IO.STREAM, -- IOs for error and system status reporting ch: Commander.Handle_NIL ]; pd: REF PD; ROPE: TYPE=Rope.ROPE; WhereToReport: TYPE=ATOM; ThHandle: TYPE = LONG CARDINAL -- Thrush.ThHandle --; nullHandle: ThHandle = 0; nullValue: IO.Value = [null[]]; WhereProc: TYPE = PROC[fixedWhereData: REF, whereData: REF] RETURNS[s: IO.STREAM_NIL]; DNFProc: TYPE = PROC[fixedWhereData: REF, whereData: REF] RETURNS[default: BOOL]; RegisterWhereToReport: PROC[ proc: WhereProc_NIL, where: WhereToReport, fixedWhereData: REF_NIL, defaultIfNotFound: DNFProc_NIL]; FindWhere: PROC[where: WhereToReport, whereData: REF] RETURNS [s: IO.STREAM_NIL]; Report: PROC[remark: ROPE, where: WhereToReport_NIL, whereData: REF _NIL]; ReportFR: PROC[remark: ROPE, where: WhereToReport_NIL, whereData: REF _NIL, a1, a2: IO.Value _ nullValue]; Problem: PROC[ remark: ROPE_NIL, where: WhereToReport_NIL, whereData: REF _NIL]; ProblemFR: PROC[ remark: ROPE_NIL, where: WhereToReport_NIL, whereData: REF _NIL, a1, a2: IO.Value _ nullValue]; ProblemBool: PROC[remark: ROPE_NIL, where: WhereToReport_NIL, bool: BOOL_FALSE, whereData: REF_NIL] RETURNS[sameBool: BOOL]; ProblemHandle: PROC[remark: ROPE_NIL, where: WhereToReport_NIL, handle: ThHandle _ nullHandle, whereData: REF_NIL] RETURNS[sameHandle: ThHandle]; CLog: TYPE = REF CLogBody; CLogBody: TYPE = RECORD [ logStream: IO.STREAM, logReadPos: INT_0, CommandProc: PROC[CLog] ]; MakeCLog: PROC[fileName: ROPE, CommandProc: PROC[CLog], new: BOOL_FALSE, keep: CARDINAL_2] RETURNS[cLog: CLog]; WriteCLog: PROC[cLog: CLog, entry: ROPE]; CloseCLog: PROC[cLog: CLog] RETURNS[nullCLog: CLog]; DoCLog: PROC[cLog: CLog, entry: ROPE]; RedoCLog: PROC[cLog: CLog]; GetBinding: PROC[qualifiedName: ROPE] RETURNS [tv: AMTypes.TV]; GetBindingToProc: PROC[qualifiedProcName: ROPE] RETURNS [proc: PROC ANY RETURNS ANY]; }. Log.mesa Error logging, "transaction" logging utilities for voice systems Copyright c 1985 by Xerox Corporation. All rights reserved. Last modified by D. Swinehart, July 19, 1985 2:40:15 pm PDT Variables Types Error reporting and management Report finds an appropriate stream and prints a time-stamped version of remark. Clients can register procedures to interpret the WhereToReport atoms and obtain the appropriate stream for a given call, aided by the lead supplied in the Report call. Problem is intended for reporting unexpected errors and conditions. It will raise the indicated signal, or an internal one by default, if the system is currently attended (there's an executive command.) In any case, it will report the remark argument. It will return automatically or if the operator proceeds from the signal, so the caller needs to do what is necessary to recover after calling Problem. The other Problem... functions are for convenience in returning innocuous values from procedures. The defaultIfNotFound parameter to the registration procedure indicates whether the message should be ignored (FALSE) or printed (TRUE) when the corresponding stream-finding procedure returns NIL. IF defaultIfNotFound=NIL, answer assumed TRUE Command Logging, indirect execution. Used, among others, by Nuthatch. CommandProc should consume any command in the log, such that if it's the last command, we're at end of file Write it at end, then read it and do it, using CommandProc Typical thing to do after a MakeCLog, to replay an old one. Dynamic "IsBound"; applies to procedures only. qualifiedName is either Interface.variable or Program.variable. Returns NIL if the Interface, Program, or variable is undefined. Assumes global context. I suppose there's a way to speed it up by looking for top level. qualifiedProcName is either Interface.Proc or Program.Proc. Returns NIL if the Interface, Program, or Proc is undefined. Swinehart, July 19, 1985 2:34:21 pm PDT Clean up, eliminate SLOG stuff (Break Tool, Spy, Celtics dominate), DIRECTORY, Log ΚΖ˜šœ™J™@Icodešœ Οmœ1™Jš œžœžœ žœžœ˜%Jšžœ žœ˜—š   œžœ žœžœžœ˜?Jšœ*žœžœ˜2Jšžœ˜—J˜—™$J™ J™Jšœžœžœ ˜šœ žœžœ˜Jšœ žœžœ˜Jšœ žœ˜š  œžœ˜J™MJ™—J˜—J˜š œžœ žœ  œžœ žœžœžœ˜ZJšœ˜—J˜Jš  œžœžœ˜)J˜Jš  œžœ žœ˜4J˜š œžœžœ˜&J™:—J˜š œžœ ˜J™;—J™—™.š   œžœžœžœžœ˜?Jšœ?™?Jšœ@™@Jšœžœ?™Y—J˜š œžœžœžœžœžœžœžœ˜UJ™;J™<——J˜™'KšœBΟr™R—K™K™—…— Ϊ