Home » Archimedes archive » Acorn User » AU 1997-Xmas B.adf » PD » NetPlex/!Netplex/!SysLog/!Help

NetPlex/!Netplex/!SysLog/!Help

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1997-Xmas B.adf » PD
Filename: NetPlex/!Netplex/!SysLog/!Help
Read OK:
File size: 51CB bytes
Load address: 0000
Exec address: 0000
File contents
============================================================================
SysLog Documentation
----------------------------------------------------------------------------
Version: 0.16
Author:  Jon Ribbens <jon@doggysoft.co.uk>

(c) DoggySoft Ltd., 1995, 1996

This program is Freeware and may be freely distributed so long as it is
not charged for, and none of the files are changed or removed. It may be
included with a commercial program which is charged for. There is no
warranty, express or implied. DoggySoft Ltd. is not liable for any loss
or damages caused by the use or misuse of this program.


Things done:
  * facility to insert arbitrary line
  * considered format of datestamp
  * implemented backoff system for errors writing to logs (partly a bugfix)
  * fixed bug which left files open on errors (e.g. disk full)
  * added Indent/UnIndent/NoIndent
  * do 'temporary logs' thingy for Termite session logs
  * implement log truncation at specified maximum size
  * read <SysLog$Dir> once and once only at startup
  * do automatic tidy-up of 'temporary logs'
  * fixed bug which corrupted the very last line in the options file
  * get allocation for SWI chunk and module name and OS commands
  * user options to disable session logs
  * added "*" line in options file to specify default values
  * reserve disk space option
  * make entry point use two-layer task, so RMEnsuring works
  * add *SysLog ON|OFF and *SysLog <log> <new priority>
  * LogData routine to log a block of hex data (e.g. IP packets)
  * add debugf routine for assembler people
  * add C front-end for C people
  * added SysLog_ReadErrorMessage
  * added %<reg>p and %<reg>a to LogFormatted
  * fixed order of %<reg>a (it was backwards)
  * made log buffer size dependent on logging level
  * made log buffer get de-allocated after ten minutes
  * added SysLog_LogComplete
  * made buffer size be recalculated when log level is changed
  * made setting log level also apply to session logs of that log
  * fixed tidying up of stray session logs (sometimes missed some)
  * fixed a few problems with sessions
  * termination of strings is now by zero-byte or carriage return
  * add log_forget and call it in CloseSessionLog

To do:
  * add expression evaluation to LogFormatted
  * add optional checking of pointer validity
  * add 'features flags'

============================================================================
Rationale
----------------------------------------------------------------------------

Termite is currently lacking in logging facilities. In fact, most
communications software for the Arc is rather poor at logging. This module
is designed to make it easy for comprehensive logging to be added to any
RISC OS program.

The logging level can be altered by the user for individual log files, and
buffering is used to speed logging, so it is safe for programs to log large
quantities of data, provided that they use sensible priorities for each type
of message. The logs are also automatically kept to user-specified maximum
lengths, so there is no need to worry about filling up the user's hard disk.

Separate log files are used for each application, on the basis that such
segregation of information makes it much easier for the user to find what
they're looking for.

A back-off system is used for dealing with errors when writing to logs. Each
error is logged in the "SysLog" log, and the offending log is marked as
"dead". SysLog will then not attempt to write to that log again for one
second. If we again get an error writing to the log, we multiply the
"back-off" time by 1.5, and again mark the log as dead. The back-off time is
not allowed to grow longer than ten minutes.


============================================================================
Session logs
----------------------------------------------------------------------------

Usually, log entries are stored strictly chronologically. Sometimes, though,
it may be more useful to store them grouped by 'session'. For example,
NewsBite can have several incoming NNTP connections at once. It is nice to
group the log messages that are coming from each separate connection
together. This can be done using SysLog_OpenSessionLog.

SysLog_OpenSessionLog creates a specially-named temporary log file. The log
entries for the session are stored in this log file. When the temporary log
file is closed using SysLog_CloseSessionLog, this data is appended in one
chunk to the end of the main log.

SysLog checks for stray temporary log files when it initialises and
finalises, and appends them to the relevant logs. This copes with the
situation where an application crashes or otherwise exits without calling
SysLog_CloseSessionLog.


============================================================================
Priorities
----------------------------------------------------------------------------

Message priorities can be in the range 0 to 255, with 0 being the highest
priority and 255 being the lowest. Unless otherwise specified by the user,
only messages with priorities of less than 125 are stored in the log files.
You should therefore think about what things the user is likely to want to
have logged by default, and ensure that these things are logged at
a priority of 124 or less.

The priority of errors often depends on how significant the consequences of
the error are, not what the cause of it is. e.g. sometimes "out of memory"
will be an extremely important unrecoverable error (because the program
can't start up), and sometimes it will be unimportant (because the program
can use disk instead, or maybe try again later).


============================================================================
Log names
----------------------------------------------------------------------------

Log names are used as the leafnames to store the logs as, so they must
comply with the rules for RISC OS leafnames. They must also not be longer
than ten characters.

It is intended that each application have its own log, so an obvious choice
for the log name is the application name (without the '!'). Very large
applications could have more than one log file - in which case the naming
scheme is unspecified. Try and choose sensible log names.

If your application is going to be distributed, you should write to
support@doggysoft.co.uk, to request that your log name be formally
allocated. This will hopefully avoid having more than one program using the
same log file.

The following log names are reserved for internal use:

  any name beginning with a '-' character
  any name beginning with "SysLog"
  "Old"


============================================================================
OS commands
----------------------------------------------------------------------------

*SysLog <log name> <priority> <message>
 ------

Adds a time-stamped message to the log file, if and only if the specified
log file is set up to log messages of this priority. The priority must be in
the range 0-255.


*SysLog <log name> <new priority>
 ------

Temporarily (but with immediate effect) changes the logging priority of the
specified log. The priority must be in the range 0-256.


*SysLog ON|OFF
 ------

*SysLog OFF will temporary disable SysLog - all log messages received after
this command is issued will be ignored. *SysLog ON resumes normal operation.


*SysLog_Flush ON|OFF
 ------------

*SysLog_Flush with no paramaters flushes all currently open log files to
disk. If it used with the parameter 'ON' then it causes all log files to be
flushed immediately after each message is written to them. *SysLog_Flush OFF
disables this behaviour. (This is intended for use when the a program is
being debugged, and keeps crashing the computer. With SysLog_Flush ON,
you're guaranteed that all the log information your program produces before
it crashes will actually be available after a re-boot. It also makes logging
*very slow*.)


============================================================================
SWIs
----------------------------------------------------------------------------

SysLog_LogMessage (&4C880)
-----------------
R0-> log name, or = session log handle
R1-> text to log
R2 = priority

Adds a time-stamped message to the log file, if and only if the specified
log file is set up to log messages of this priority. The text to log must
not be longer than 1024 bytes. The priority must be in the range 0-255.


SysLog_GetLogLevel (&4C881)
------------------
R0-> log name, or = session log handle
exit:
R0 = priority

Reads the logging level for the specified log. Messages of *less than* the
returned priority are being logged. This can be used to avoid creation of
logging information that is only going to be discarded by SysLog_LogMessage
anyway. In some cases it could even be used to decide which version of
a program to load (e.g. whether to load a debugging version of TermiteIP).


SysLog_FlushLog (&4C882)
---------------
R0-> log name, or = session log handle, or = 0 to flush all logs

Ensures the specified log (or all logs) are fully written to disk, and the
files closed. This can be useful to make sure that the user is immediately
able to read data that has just been written to the log.


SysLog_SetLogLevel (&4C883)
------------------
R0-> log name, or = session log handle
R1 = new logging level

Sets the logging level for the specified log. This SWI is provided for
debugging and internal use only, and SHOULD NOT BE USED in distribution
code. The logging level is the user's decision, not the programmer's.


SysLog_LogUnstamped (&4C884)
-------------------
R0-> log name, or = session log handle
R1-> text to log
R2 = priority

Adds a message to the log file, if and only if the specified log file is set
to log messages of this priority. The text to log must not be longer than
1024 bytes. The priority must be in the range 0-255. It is recommended that
you use SysLog_LogMessage for all normal log entries.


SysLog_Indent (&4C885)
-------------
R0-> log name, or = session log handle

Increments the log indent level. In log lines generated by
SysLog_LogMessage, there are <indent_level + 1> spaces in between the
priority and the message. This can be useful to show the hierarchy of the
functions which are producing logging output. The indent level is initially
zero.


SysLog_UnIndent (&4C886)
---------------
R0-> log name, or = session log handle

Decrements the log indent level. (If it is zero it is not decremented.)


SysLog_NoIndent (&4C887)
---------------
R0-> log name, or = session log handle

Sets the log indent level to zero. This should be called when your program
loads, if you are using SysLog_Indent/UnIndent.


SysLog_OpenSessionLog (&4C888)
---------------------
R0-> log name
R1 = priority
exit:
R0 = session log handle (or 0)

Creates a temporary session log file. When the session log is closed (using
SysLog_CloseSessionLog, below), the session log is appended to the main log
as specified in R0 on entry to this SWI. If the main log is set to ignore
log entries of the priority specified then zero will be returned for the
session log handle. This does not necessarily require special case code, as
other SWIs which accept session log handles will accept a handle of zero and
do nothing.


SysLog_CloseSessionLog (&4C889)
----------------------
R0 = session log handle

Closes the specified temporary session log and appends it to the appropriate
main log file. The specified session log handle is no longer valid.


SysLog_LogData (&4C88A)
--------------
R0-> log name, or = session log handle
R1 = priority
R2-> data to log
R3 = number of bytes to log
R4 = value to report as block offset (-1 not to show block offset)

Logs a block of data, in a hex-and-ASCII format similar to that produced by
*Dump. The block offset is the value that is printed at the beginning of
each line, which is equal to the value given on entry plus the number of
bytes already displayed. If -1 is used as the block offset then the field
will be omitted. Note that if the number of bytes to log is over 10KB then
the SWI will return with an error - logging such a large amount of data in
one go is almost certainly a bug, so SysLog faults it to prevent the
computer going into a semi-infinite loop while it writes huge amounts of
data to disk.


SysLog_LogFormatted (&4C88B)
-------------------
R0-> log name, or = session log handle
R1-> format string
R2 = priority
R3-> block containing R0-R3,R8-R12,R14
R4-R7 = parameters

Evaluates a formatted string using registers R4-R7, and R0-R3, R8-R12 and
R14 from the block passed in R3, and logs the result. See the section
"LogFormatted", below.


SysLog_ReadErrorMessage (&4C88C)
-----------------------
R0 = error number
exit:
R0-> error message

Converts an error number as returned by the FreeNet/Internet/etc modules
into a string describing the error. e.g. SysLog_ReadErrorMessage 60 would
return "Connection timed out".


SysLog_LogComplete (&4C88D)
------------------
R0-> log name

Flushes the specified log, and de-allocates the buffer associated with it.
This should only be called if the log is definitely not going to be used for
a while (e.g. if your application is the only one which can be writing to
the log, and it's exiting). If this isn't called explicity, SysLog
automatically de-allocates the log buffer after ten minutes of inactivity in
the log.


============================================================================
LogFormatted
----------------------------------------------------------------------------

SWI SysLog_LogFormatted provides C "printf"-style functionality for
assembler programmers. A format string is passed in R1, which is a template
for the output. The string is copied directly to the output, except for '%'
characters, which inserts a string calculated when the SWI is called:

        %%      - the literal '%' character
        %<reg>a - the network-byte-ordered IP address in register <reg>
        %<reg>c - the character in register <reg>
        %<reg>d - the signed decimal integer in register <reg>
        %<reg>e - the message for the FreeNet error number in register <reg>
        %<reg>f - the filename of the file handle in register <reg>
        %<reg>p - the object pointed to by register <reg>
        %<reg>s - the control-terminated string pointed to by register <reg>
        %<reg>x - the unsigned hexadecimal integer in register <reg>
        %<reg>z - the zero-terminated string pointed to by register <reg>

   where <reg> is a number which can be any of 0 to 12 or 14.

Note that the %<reg>p type must be followed by another type indicator. For
example, to log a character pointed to by register R3, use "%3pc". More than
one 'p' can be used to indicate more than one level of indirection.

Null pointers are explicitly checked for wherever used, and the string
"(null)" is logged in place of whatever should have been output. Hence it
is explicity defined that it is safe to allow null pointers to be in
registers used by the format string.

Registers R4-R7 are taken directly from the registers passed to the SWI.
Registers R0-R3, R8-R12 and R14 are taken from the block passed in R3.

It is expected that this SWI would be packaged in a macro in your assembler
source code. For example:

...
.stricmp
  FNlogf("stricmp: comparing %0z and %1z",200)
...

DEF FNlogf(t$,p%)
  [OPT p
    STMFD   R13!,{R0-R3,R8-R12,R14}
    ADR     R0,txt_logname
    ADD     R1,R15,#12
    MOV     R2,#p%
    MOV     R3,R13
    SWI     "SysLog_LogFormatted"
    B       P%+(LENt$+8)ANDNOT3
    EQUS    t$+STRING$(4-(LENt$AND3),CHR$0)
    LDMFD   R13!,{R0-R3,R8-R12,R14}
  ]
=p

or the ObjAsm equivalent:

        MACRO
        LOGF    $t,$p

        STMFD   R13!,{R0-R3,R8-R12,R14}
        ADR     R0,txt_logname
        ADR     R1,%ft90
        MOV     R2,#$p
        MOV     R3,R13
        SWI     SysLog_LogFormatted
        B       %ft91
90
        =       "$t",0
        ALIGN
91      LDMFD   R13!,{R0-R3,R8-R12,R14}
        MEND

...
stricmp ROUT
        LOGF    "stricmp: comparing %0z and %1z",200
...


============================================================================
Using SysLog from C programs
----------------------------------------------------------------------------

To make SysLog easy to use from C programs, I have written an APCS veneer
for the module. This takes the form of a "syslog.h" header file which you
should #include from your C source, and a "syslog.o" object file which you
should link your program with.

There are two calls for each SWI, one which uses the non-X form and one
which uses the X form and returns a _kernel_oserror *. The non-X forms are
generally nicer as values can be returned in the usual manner, rather than
having to pass a pointer to a location to be filled in with the return code.
I would suggest only using the X forms when you absolutely must - i.e. in
module code, etc.

There's also a bonus function "syslogf" (and "xsyslogf") which is like
"printf" except it outputs to the log. The first two arguments are the
logname and priority, and the rest are the usual printf arguments (i.e.
the format string followed by a variable number of arguments).

Note that a temporary buffer is used to hold the string before it is passed
to the SysLog module and *THIS BUFFER IS ONLY 1024 BYTES LONG*. i.e. you
must ensure that your format string cannot ever produce more than 1024 bytes
of output. This is especially important in networking software where the
input may be coming from a Bad Miscreant who is trying to hack into or crash
your machine.

The ObjAsm source to the veneer object file is provided. If you make any
changes which you think people might find useful, or you find any bugs,
please e-mail me and tell me about it.

Thanks go to Stewart Brodie for assistance with vsprintf ;-).


============================================================================
Options
----------------------------------------------------------------------------

The options file is stored as !SysLog.Options. Each line of the options file
specifies the options for a single log. This line is of the format:
    <logname> [Reserve <size>|NoReserve] [Sessions|NoSessions]
              [<level> [<max. size>]]
<size> and <max. size> are specified in kilobytes.

An entry for log "*" is treated as the default values, which are used if
the log doesn't have a specific entry in the Options file. So, for example,
to specify "NoSessions" for every log except "NewsBite" you could use:
  * NoSessions
  NewsBite Sessions

The options have the following meanings:

  Reserve <size>
    SysLog will make sure that at least <size> KB of disk space is free for
    this log, by padding the log file with zeros which are later overwritten
    by the real log data.
  NoReserve
    SysLog won't reserve disk space for this log as described above. This is
    the default.

  Sessions
    SysLog will use Session Logs for this log (as described above) where
    instructed. This is the default.
  NoSessions
    Session Logs are disabled for this log, and log entries will appear
    strictly in chronological order.

  <level>
    SysLog will ignore log entries for this log which have a priority
    greater to or equal than this value. The default value is 125.

  <max. size>
    The log will be moved to the "Old" directory when it becomes larger
    than this size. The default value is 256KB.


============================================================================
Usage guidelines
----------------------------------------------------------------------------

Previously in this section I recommended that programs should not fail to
work if logging is not available. This is reasonable - however there are
very few reasons that logging will fail, and all of these reasons are very
likely to cause the main function of the program to fail. I would suggest
therefore that programs should RMEnsure the SysLog module in their !Run
files, and then use it as any other SWI.

Errors from SysLog SWIs, while strictly speaking non-fatal for the main
program, are indicative of something being badly wrong with the system. Use
'X' SWIs in situations such as modules where you have to, of course, but in
application code where you have an error handler, you might as well use the
non-'X' form and treat the errors as you would any other.

Programs which use SysLog should RMEnsure it in their !Run files. The
suggested lines to use are as follows:

If "<SysLog$Dir>"="" then Error !SysLog application not seen by filer
RMEnsure SysLog 0.16 Run <SysLog$Dir>.!Run
RMEnsure SysLog 0.16 Error MyApp needs SysLog 0.16 or later

Note that you should *not* just RMLoad the SysLog module, as it requires its
Wimp task to be activated, and this will not happen if you just RMLoad the
module. The module has a two-stage application entry point, so it will
return immediately when you RMRun it, allowing the !Run file to continue as
normal.
00000000  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00000040  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 0a 53 79 73  |============.Sys|
00000050  4c 6f 67 20 44 6f 63 75  6d 65 6e 74 61 74 69 6f  |Log Documentatio|
00000060  6e 0a 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |n.--------------|
00000070  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000000a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0a 56  |--------------.V|
000000b0  65 72 73 69 6f 6e 3a 20  30 2e 31 36 0a 41 75 74  |ersion: 0.16.Aut|
000000c0  68 6f 72 3a 20 20 4a 6f  6e 20 52 69 62 62 65 6e  |hor:  Jon Ribben|
000000d0  73 20 3c 6a 6f 6e 40 64  6f 67 67 79 73 6f 66 74  |s <jon@doggysoft|
000000e0  2e 63 6f 2e 75 6b 3e 0a  0a 28 63 29 20 44 6f 67  |.co.uk>..(c) Dog|
000000f0  67 79 53 6f 66 74 20 4c  74 64 2e 2c 20 31 39 39  |gySoft Ltd., 199|
00000100  35 2c 20 31 39 39 36 0a  0a 54 68 69 73 20 70 72  |5, 1996..This pr|
00000110  6f 67 72 61 6d 20 69 73  20 46 72 65 65 77 61 72  |ogram is Freewar|
00000120  65 20 61 6e 64 20 6d 61  79 20 62 65 20 66 72 65  |e and may be fre|
00000130  65 6c 79 20 64 69 73 74  72 69 62 75 74 65 64 20  |ely distributed |
00000140  73 6f 20 6c 6f 6e 67 20  61 73 20 69 74 20 69 73  |so long as it is|
00000150  0a 6e 6f 74 20 63 68 61  72 67 65 64 20 66 6f 72  |.not charged for|
00000160  2c 20 61 6e 64 20 6e 6f  6e 65 20 6f 66 20 74 68  |, and none of th|
00000170  65 20 66 69 6c 65 73 20  61 72 65 20 63 68 61 6e  |e files are chan|
00000180  67 65 64 20 6f 72 20 72  65 6d 6f 76 65 64 2e 20  |ged or removed. |
00000190  49 74 20 6d 61 79 20 62  65 0a 69 6e 63 6c 75 64  |It may be.includ|
000001a0  65 64 20 77 69 74 68 20  61 20 63 6f 6d 6d 65 72  |ed with a commer|
000001b0  63 69 61 6c 20 70 72 6f  67 72 61 6d 20 77 68 69  |cial program whi|
000001c0  63 68 20 69 73 20 63 68  61 72 67 65 64 20 66 6f  |ch is charged fo|
000001d0  72 2e 20 54 68 65 72 65  20 69 73 20 6e 6f 0a 77  |r. There is no.w|
000001e0  61 72 72 61 6e 74 79 2c  20 65 78 70 72 65 73 73  |arranty, express|
000001f0  20 6f 72 20 69 6d 70 6c  69 65 64 2e 20 44 6f 67  | or implied. Dog|
00000200  67 79 53 6f 66 74 20 4c  74 64 2e 20 69 73 20 6e  |gySoft Ltd. is n|
00000210  6f 74 20 6c 69 61 62 6c  65 20 66 6f 72 20 61 6e  |ot liable for an|
00000220  79 20 6c 6f 73 73 0a 6f  72 20 64 61 6d 61 67 65  |y loss.or damage|
00000230  73 20 63 61 75 73 65 64  20 62 79 20 74 68 65 20  |s caused by the |
00000240  75 73 65 20 6f 72 20 6d  69 73 75 73 65 20 6f 66  |use or misuse of|
00000250  20 74 68 69 73 20 70 72  6f 67 72 61 6d 2e 0a 0a  | this program...|
00000260  0a 54 68 69 6e 67 73 20  64 6f 6e 65 3a 0a 20 20  |.Things done:.  |
00000270  2a 20 66 61 63 69 6c 69  74 79 20 74 6f 20 69 6e  |* facility to in|
00000280  73 65 72 74 20 61 72 62  69 74 72 61 72 79 20 6c  |sert arbitrary l|
00000290  69 6e 65 0a 20 20 2a 20  63 6f 6e 73 69 64 65 72  |ine.  * consider|
000002a0  65 64 20 66 6f 72 6d 61  74 20 6f 66 20 64 61 74  |ed format of dat|
000002b0  65 73 74 61 6d 70 0a 20  20 2a 20 69 6d 70 6c 65  |estamp.  * imple|
000002c0  6d 65 6e 74 65 64 20 62  61 63 6b 6f 66 66 20 73  |mented backoff s|
000002d0  79 73 74 65 6d 20 66 6f  72 20 65 72 72 6f 72 73  |ystem for errors|
000002e0  20 77 72 69 74 69 6e 67  20 74 6f 20 6c 6f 67 73  | writing to logs|
000002f0  20 28 70 61 72 74 6c 79  20 61 20 62 75 67 66 69  | (partly a bugfi|
00000300  78 29 0a 20 20 2a 20 66  69 78 65 64 20 62 75 67  |x).  * fixed bug|
00000310  20 77 68 69 63 68 20 6c  65 66 74 20 66 69 6c 65  | which left file|
00000320  73 20 6f 70 65 6e 20 6f  6e 20 65 72 72 6f 72 73  |s open on errors|
00000330  20 28 65 2e 67 2e 20 64  69 73 6b 20 66 75 6c 6c  | (e.g. disk full|
00000340  29 0a 20 20 2a 20 61 64  64 65 64 20 49 6e 64 65  |).  * added Inde|
00000350  6e 74 2f 55 6e 49 6e 64  65 6e 74 2f 4e 6f 49 6e  |nt/UnIndent/NoIn|
00000360  64 65 6e 74 0a 20 20 2a  20 64 6f 20 27 74 65 6d  |dent.  * do 'tem|
00000370  70 6f 72 61 72 79 20 6c  6f 67 73 27 20 74 68 69  |porary logs' thi|
00000380  6e 67 79 20 66 6f 72 20  54 65 72 6d 69 74 65 20  |ngy for Termite |
00000390  73 65 73 73 69 6f 6e 20  6c 6f 67 73 0a 20 20 2a  |session logs.  *|
000003a0  20 69 6d 70 6c 65 6d 65  6e 74 20 6c 6f 67 20 74  | implement log t|
000003b0  72 75 6e 63 61 74 69 6f  6e 20 61 74 20 73 70 65  |runcation at spe|
000003c0  63 69 66 69 65 64 20 6d  61 78 69 6d 75 6d 20 73  |cified maximum s|
000003d0  69 7a 65 0a 20 20 2a 20  72 65 61 64 20 3c 53 79  |ize.  * read <Sy|
000003e0  73 4c 6f 67 24 44 69 72  3e 20 6f 6e 63 65 20 61  |sLog$Dir> once a|
000003f0  6e 64 20 6f 6e 63 65 20  6f 6e 6c 79 20 61 74 20  |nd once only at |
00000400  73 74 61 72 74 75 70 0a  20 20 2a 20 64 6f 20 61  |startup.  * do a|
00000410  75 74 6f 6d 61 74 69 63  20 74 69 64 79 2d 75 70  |utomatic tidy-up|
00000420  20 6f 66 20 27 74 65 6d  70 6f 72 61 72 79 20 6c  | of 'temporary l|
00000430  6f 67 73 27 0a 20 20 2a  20 66 69 78 65 64 20 62  |ogs'.  * fixed b|
00000440  75 67 20 77 68 69 63 68  20 63 6f 72 72 75 70 74  |ug which corrupt|
00000450  65 64 20 74 68 65 20 76  65 72 79 20 6c 61 73 74  |ed the very last|
00000460  20 6c 69 6e 65 20 69 6e  20 74 68 65 20 6f 70 74  | line in the opt|
00000470  69 6f 6e 73 20 66 69 6c  65 0a 20 20 2a 20 67 65  |ions file.  * ge|
00000480  74 20 61 6c 6c 6f 63 61  74 69 6f 6e 20 66 6f 72  |t allocation for|
00000490  20 53 57 49 20 63 68 75  6e 6b 20 61 6e 64 20 6d  | SWI chunk and m|
000004a0  6f 64 75 6c 65 20 6e 61  6d 65 20 61 6e 64 20 4f  |odule name and O|
000004b0  53 20 63 6f 6d 6d 61 6e  64 73 0a 20 20 2a 20 75  |S commands.  * u|
000004c0  73 65 72 20 6f 70 74 69  6f 6e 73 20 74 6f 20 64  |ser options to d|
000004d0  69 73 61 62 6c 65 20 73  65 73 73 69 6f 6e 20 6c  |isable session l|
000004e0  6f 67 73 0a 20 20 2a 20  61 64 64 65 64 20 22 2a  |ogs.  * added "*|
000004f0  22 20 6c 69 6e 65 20 69  6e 20 6f 70 74 69 6f 6e  |" line in option|
00000500  73 20 66 69 6c 65 20 74  6f 20 73 70 65 63 69 66  |s file to specif|
00000510  79 20 64 65 66 61 75 6c  74 20 76 61 6c 75 65 73  |y default values|
00000520  0a 20 20 2a 20 72 65 73  65 72 76 65 20 64 69 73  |.  * reserve dis|
00000530  6b 20 73 70 61 63 65 20  6f 70 74 69 6f 6e 0a 20  |k space option. |
00000540  20 2a 20 6d 61 6b 65 20  65 6e 74 72 79 20 70 6f  | * make entry po|
00000550  69 6e 74 20 75 73 65 20  74 77 6f 2d 6c 61 79 65  |int use two-laye|
00000560  72 20 74 61 73 6b 2c 20  73 6f 20 52 4d 45 6e 73  |r task, so RMEns|
00000570  75 72 69 6e 67 20 77 6f  72 6b 73 0a 20 20 2a 20  |uring works.  * |
00000580  61 64 64 20 2a 53 79 73  4c 6f 67 20 4f 4e 7c 4f  |add *SysLog ON|O|
00000590  46 46 20 61 6e 64 20 2a  53 79 73 4c 6f 67 20 3c  |FF and *SysLog <|
000005a0  6c 6f 67 3e 20 3c 6e 65  77 20 70 72 69 6f 72 69  |log> <new priori|
000005b0  74 79 3e 0a 20 20 2a 20  4c 6f 67 44 61 74 61 20  |ty>.  * LogData |
000005c0  72 6f 75 74 69 6e 65 20  74 6f 20 6c 6f 67 20 61  |routine to log a|
000005d0  20 62 6c 6f 63 6b 20 6f  66 20 68 65 78 20 64 61  | block of hex da|
000005e0  74 61 20 28 65 2e 67 2e  20 49 50 20 70 61 63 6b  |ta (e.g. IP pack|
000005f0  65 74 73 29 0a 20 20 2a  20 61 64 64 20 64 65 62  |ets).  * add deb|
00000600  75 67 66 20 72 6f 75 74  69 6e 65 20 66 6f 72 20  |ugf routine for |
00000610  61 73 73 65 6d 62 6c 65  72 20 70 65 6f 70 6c 65  |assembler people|
00000620  0a 20 20 2a 20 61 64 64  20 43 20 66 72 6f 6e 74  |.  * add C front|
00000630  2d 65 6e 64 20 66 6f 72  20 43 20 70 65 6f 70 6c  |-end for C peopl|
00000640  65 0a 20 20 2a 20 61 64  64 65 64 20 53 79 73 4c  |e.  * added SysL|
00000650  6f 67 5f 52 65 61 64 45  72 72 6f 72 4d 65 73 73  |og_ReadErrorMess|
00000660  61 67 65 0a 20 20 2a 20  61 64 64 65 64 20 25 3c  |age.  * added %<|
00000670  72 65 67 3e 70 20 61 6e  64 20 25 3c 72 65 67 3e  |reg>p and %<reg>|
00000680  61 20 74 6f 20 4c 6f 67  46 6f 72 6d 61 74 74 65  |a to LogFormatte|
00000690  64 0a 20 20 2a 20 66 69  78 65 64 20 6f 72 64 65  |d.  * fixed orde|
000006a0  72 20 6f 66 20 25 3c 72  65 67 3e 61 20 28 69 74  |r of %<reg>a (it|
000006b0  20 77 61 73 20 62 61 63  6b 77 61 72 64 73 29 0a  | was backwards).|
000006c0  20 20 2a 20 6d 61 64 65  20 6c 6f 67 20 62 75 66  |  * made log buf|
000006d0  66 65 72 20 73 69 7a 65  20 64 65 70 65 6e 64 65  |fer size depende|
000006e0  6e 74 20 6f 6e 20 6c 6f  67 67 69 6e 67 20 6c 65  |nt on logging le|
000006f0  76 65 6c 0a 20 20 2a 20  6d 61 64 65 20 6c 6f 67  |vel.  * made log|
00000700  20 62 75 66 66 65 72 20  67 65 74 20 64 65 2d 61  | buffer get de-a|
00000710  6c 6c 6f 63 61 74 65 64  20 61 66 74 65 72 20 74  |llocated after t|
00000720  65 6e 20 6d 69 6e 75 74  65 73 0a 20 20 2a 20 61  |en minutes.  * a|
00000730  64 64 65 64 20 53 79 73  4c 6f 67 5f 4c 6f 67 43  |dded SysLog_LogC|
00000740  6f 6d 70 6c 65 74 65 0a  20 20 2a 20 6d 61 64 65  |omplete.  * made|
00000750  20 62 75 66 66 65 72 20  73 69 7a 65 20 62 65 20  | buffer size be |
00000760  72 65 63 61 6c 63 75 6c  61 74 65 64 20 77 68 65  |recalculated whe|
00000770  6e 20 6c 6f 67 20 6c 65  76 65 6c 20 69 73 20 63  |n log level is c|
00000780  68 61 6e 67 65 64 0a 20  20 2a 20 6d 61 64 65 20  |hanged.  * made |
00000790  73 65 74 74 69 6e 67 20  6c 6f 67 20 6c 65 76 65  |setting log leve|
000007a0  6c 20 61 6c 73 6f 20 61  70 70 6c 79 20 74 6f 20  |l also apply to |
000007b0  73 65 73 73 69 6f 6e 20  6c 6f 67 73 20 6f 66 20  |session logs of |
000007c0  74 68 61 74 20 6c 6f 67  0a 20 20 2a 20 66 69 78  |that log.  * fix|
000007d0  65 64 20 74 69 64 79 69  6e 67 20 75 70 20 6f 66  |ed tidying up of|
000007e0  20 73 74 72 61 79 20 73  65 73 73 69 6f 6e 20 6c  | stray session l|
000007f0  6f 67 73 20 28 73 6f 6d  65 74 69 6d 65 73 20 6d  |ogs (sometimes m|
00000800  69 73 73 65 64 20 73 6f  6d 65 29 0a 20 20 2a 20  |issed some).  * |
00000810  66 69 78 65 64 20 61 20  66 65 77 20 70 72 6f 62  |fixed a few prob|
00000820  6c 65 6d 73 20 77 69 74  68 20 73 65 73 73 69 6f  |lems with sessio|
00000830  6e 73 0a 20 20 2a 20 74  65 72 6d 69 6e 61 74 69  |ns.  * terminati|
00000840  6f 6e 20 6f 66 20 73 74  72 69 6e 67 73 20 69 73  |on of strings is|
00000850  20 6e 6f 77 20 62 79 20  7a 65 72 6f 2d 62 79 74  | now by zero-byt|
00000860  65 20 6f 72 20 63 61 72  72 69 61 67 65 20 72 65  |e or carriage re|
00000870  74 75 72 6e 0a 20 20 2a  20 61 64 64 20 6c 6f 67  |turn.  * add log|
00000880  5f 66 6f 72 67 65 74 20  61 6e 64 20 63 61 6c 6c  |_forget and call|
00000890  20 69 74 20 69 6e 20 43  6c 6f 73 65 53 65 73 73  | it in CloseSess|
000008a0  69 6f 6e 4c 6f 67 0a 0a  54 6f 20 64 6f 3a 0a 20  |ionLog..To do:. |
000008b0  20 2a 20 61 64 64 20 65  78 70 72 65 73 73 69 6f  | * add expressio|
000008c0  6e 20 65 76 61 6c 75 61  74 69 6f 6e 20 74 6f 20  |n evaluation to |
000008d0  4c 6f 67 46 6f 72 6d 61  74 74 65 64 0a 20 20 2a  |LogFormatted.  *|
000008e0  20 61 64 64 20 6f 70 74  69 6f 6e 61 6c 20 63 68  | add optional ch|
000008f0  65 63 6b 69 6e 67 20 6f  66 20 70 6f 69 6e 74 65  |ecking of pointe|
00000900  72 20 76 61 6c 69 64 69  74 79 0a 20 20 2a 20 61  |r validity.  * a|
00000910  64 64 20 27 66 65 61 74  75 72 65 73 20 66 6c 61  |dd 'features fla|
00000920  67 73 27 0a 0a 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |gs'..===========|
00000930  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00000970  3d 0a 52 61 74 69 6f 6e  61 6c 65 0a 2d 2d 2d 2d  |=.Rationale.----|
00000980  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000009c0  2d 2d 2d 2d 2d 2d 2d 2d  0a 0a 54 65 72 6d 69 74  |--------..Termit|
000009d0  65 20 69 73 20 63 75 72  72 65 6e 74 6c 79 20 6c  |e is currently l|
000009e0  61 63 6b 69 6e 67 20 69  6e 20 6c 6f 67 67 69 6e  |acking in loggin|
000009f0  67 20 66 61 63 69 6c 69  74 69 65 73 2e 20 49 6e  |g facilities. In|
00000a00  20 66 61 63 74 2c 20 6d  6f 73 74 0a 63 6f 6d 6d  | fact, most.comm|
00000a10  75 6e 69 63 61 74 69 6f  6e 73 20 73 6f 66 74 77  |unications softw|
00000a20  61 72 65 20 66 6f 72 20  74 68 65 20 41 72 63 20  |are for the Arc |
00000a30  69 73 20 72 61 74 68 65  72 20 70 6f 6f 72 20 61  |is rather poor a|
00000a40  74 20 6c 6f 67 67 69 6e  67 2e 20 54 68 69 73 20  |t logging. This |
00000a50  6d 6f 64 75 6c 65 0a 69  73 20 64 65 73 69 67 6e  |module.is design|
00000a60  65 64 20 74 6f 20 6d 61  6b 65 20 69 74 20 65 61  |ed to make it ea|
00000a70  73 79 20 66 6f 72 20 63  6f 6d 70 72 65 68 65 6e  |sy for comprehen|
00000a80  73 69 76 65 20 6c 6f 67  67 69 6e 67 20 74 6f 20  |sive logging to |
00000a90  62 65 20 61 64 64 65 64  20 74 6f 20 61 6e 79 0a  |be added to any.|
00000aa0  52 49 53 43 20 4f 53 20  70 72 6f 67 72 61 6d 2e  |RISC OS program.|
00000ab0  0a 0a 54 68 65 20 6c 6f  67 67 69 6e 67 20 6c 65  |..The logging le|
00000ac0  76 65 6c 20 63 61 6e 20  62 65 20 61 6c 74 65 72  |vel can be alter|
00000ad0  65 64 20 62 79 20 74 68  65 20 75 73 65 72 20 66  |ed by the user f|
00000ae0  6f 72 20 69 6e 64 69 76  69 64 75 61 6c 20 6c 6f  |or individual lo|
00000af0  67 20 66 69 6c 65 73 2c  20 61 6e 64 0a 62 75 66  |g files, and.buf|
00000b00  66 65 72 69 6e 67 20 69  73 20 75 73 65 64 20 74  |fering is used t|
00000b10  6f 20 73 70 65 65 64 20  6c 6f 67 67 69 6e 67 2c  |o speed logging,|
00000b20  20 73 6f 20 69 74 20 69  73 20 73 61 66 65 20 66  | so it is safe f|
00000b30  6f 72 20 70 72 6f 67 72  61 6d 73 20 74 6f 20 6c  |or programs to l|
00000b40  6f 67 20 6c 61 72 67 65  0a 71 75 61 6e 74 69 74  |og large.quantit|
00000b50  69 65 73 20 6f 66 20 64  61 74 61 2c 20 70 72 6f  |ies of data, pro|
00000b60  76 69 64 65 64 20 74 68  61 74 20 74 68 65 79 20  |vided that they |
00000b70  75 73 65 20 73 65 6e 73  69 62 6c 65 20 70 72 69  |use sensible pri|
00000b80  6f 72 69 74 69 65 73 20  66 6f 72 20 65 61 63 68  |orities for each|
00000b90  20 74 79 70 65 0a 6f 66  20 6d 65 73 73 61 67 65  | type.of message|
00000ba0  2e 20 54 68 65 20 6c 6f  67 73 20 61 72 65 20 61  |. The logs are a|
00000bb0  6c 73 6f 20 61 75 74 6f  6d 61 74 69 63 61 6c 6c  |lso automaticall|
00000bc0  79 20 6b 65 70 74 20 74  6f 20 75 73 65 72 2d 73  |y kept to user-s|
00000bd0  70 65 63 69 66 69 65 64  20 6d 61 78 69 6d 75 6d  |pecified maximum|
00000be0  0a 6c 65 6e 67 74 68 73  2c 20 73 6f 20 74 68 65  |.lengths, so the|
00000bf0  72 65 20 69 73 20 6e 6f  20 6e 65 65 64 20 74 6f  |re is no need to|
00000c00  20 77 6f 72 72 79 20 61  62 6f 75 74 20 66 69 6c  | worry about fil|
00000c10  6c 69 6e 67 20 75 70 20  74 68 65 20 75 73 65 72  |ling up the user|
00000c20  27 73 20 68 61 72 64 20  64 69 73 6b 2e 0a 0a 53  |'s hard disk...S|
00000c30  65 70 61 72 61 74 65 20  6c 6f 67 20 66 69 6c 65  |eparate log file|
00000c40  73 20 61 72 65 20 75 73  65 64 20 66 6f 72 20 65  |s are used for e|
00000c50  61 63 68 20 61 70 70 6c  69 63 61 74 69 6f 6e 2c  |ach application,|
00000c60  20 6f 6e 20 74 68 65 20  62 61 73 69 73 20 74 68  | on the basis th|
00000c70  61 74 20 73 75 63 68 0a  73 65 67 72 65 67 61 74  |at such.segregat|
00000c80  69 6f 6e 20 6f 66 20 69  6e 66 6f 72 6d 61 74 69  |ion of informati|
00000c90  6f 6e 20 6d 61 6b 65 73  20 69 74 20 6d 75 63 68  |on makes it much|
00000ca0  20 65 61 73 69 65 72 20  66 6f 72 20 74 68 65 20  | easier for the |
00000cb0  75 73 65 72 20 74 6f 20  66 69 6e 64 20 77 68 61  |user to find wha|
00000cc0  74 0a 74 68 65 79 27 72  65 20 6c 6f 6f 6b 69 6e  |t.they're lookin|
00000cd0  67 20 66 6f 72 2e 0a 0a  41 20 62 61 63 6b 2d 6f  |g for...A back-o|
00000ce0  66 66 20 73 79 73 74 65  6d 20 69 73 20 75 73 65  |ff system is use|
00000cf0  64 20 66 6f 72 20 64 65  61 6c 69 6e 67 20 77 69  |d for dealing wi|
00000d00  74 68 20 65 72 72 6f 72  73 20 77 68 65 6e 20 77  |th errors when w|
00000d10  72 69 74 69 6e 67 20 74  6f 20 6c 6f 67 73 2e 20  |riting to logs. |
00000d20  45 61 63 68 0a 65 72 72  6f 72 20 69 73 20 6c 6f  |Each.error is lo|
00000d30  67 67 65 64 20 69 6e 20  74 68 65 20 22 53 79 73  |gged in the "Sys|
00000d40  4c 6f 67 22 20 6c 6f 67  2c 20 61 6e 64 20 74 68  |Log" log, and th|
00000d50  65 20 6f 66 66 65 6e 64  69 6e 67 20 6c 6f 67 20  |e offending log |
00000d60  69 73 20 6d 61 72 6b 65  64 20 61 73 0a 22 64 65  |is marked as."de|
00000d70  61 64 22 2e 20 53 79 73  4c 6f 67 20 77 69 6c 6c  |ad". SysLog will|
00000d80  20 74 68 65 6e 20 6e 6f  74 20 61 74 74 65 6d 70  | then not attemp|
00000d90  74 20 74 6f 20 77 72 69  74 65 20 74 6f 20 74 68  |t to write to th|
00000da0  61 74 20 6c 6f 67 20 61  67 61 69 6e 20 66 6f 72  |at log again for|
00000db0  20 6f 6e 65 0a 73 65 63  6f 6e 64 2e 20 49 66 20  | one.second. If |
00000dc0  77 65 20 61 67 61 69 6e  20 67 65 74 20 61 6e 20  |we again get an |
00000dd0  65 72 72 6f 72 20 77 72  69 74 69 6e 67 20 74 6f  |error writing to|
00000de0  20 74 68 65 20 6c 6f 67  2c 20 77 65 20 6d 75 6c  | the log, we mul|
00000df0  74 69 70 6c 79 20 74 68  65 0a 22 62 61 63 6b 2d  |tiply the."back-|
00000e00  6f 66 66 22 20 74 69 6d  65 20 62 79 20 31 2e 35  |off" time by 1.5|
00000e10  2c 20 61 6e 64 20 61 67  61 69 6e 20 6d 61 72 6b  |, and again mark|
00000e20  20 74 68 65 20 6c 6f 67  20 61 73 20 64 65 61 64  | the log as dead|
00000e30  2e 20 54 68 65 20 62 61  63 6b 2d 6f 66 66 20 74  |. The back-off t|
00000e40  69 6d 65 20 69 73 0a 6e  6f 74 20 61 6c 6c 6f 77  |ime is.not allow|
00000e50  65 64 20 74 6f 20 67 72  6f 77 20 6c 6f 6e 67 65  |ed to grow longe|
00000e60  72 20 74 68 61 6e 20 74  65 6e 20 6d 69 6e 75 74  |r than ten minut|
00000e70  65 73 2e 0a 0a 0a 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |es....==========|
00000e80  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00000ec0  3d 3d 0a 53 65 73 73 69  6f 6e 20 6c 6f 67 73 0a  |==.Session logs.|
00000ed0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000f10  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 0a 0a 55 73  |------------..Us|
00000f20  75 61 6c 6c 79 2c 20 6c  6f 67 20 65 6e 74 72 69  |ually, log entri|
00000f30  65 73 20 61 72 65 20 73  74 6f 72 65 64 20 73 74  |es are stored st|
00000f40  72 69 63 74 6c 79 20 63  68 72 6f 6e 6f 6c 6f 67  |rictly chronolog|
00000f50  69 63 61 6c 6c 79 2e 20  53 6f 6d 65 74 69 6d 65  |ically. Sometime|
00000f60  73 2c 20 74 68 6f 75 67  68 2c 0a 69 74 20 6d 61  |s, though,.it ma|
00000f70  79 20 62 65 20 6d 6f 72  65 20 75 73 65 66 75 6c  |y be more useful|
00000f80  20 74 6f 20 73 74 6f 72  65 20 74 68 65 6d 20 67  | to store them g|
00000f90  72 6f 75 70 65 64 20 62  79 20 27 73 65 73 73 69  |rouped by 'sessi|
00000fa0  6f 6e 27 2e 20 46 6f 72  20 65 78 61 6d 70 6c 65  |on'. For example|
00000fb0  2c 0a 4e 65 77 73 42 69  74 65 20 63 61 6e 20 68  |,.NewsBite can h|
00000fc0  61 76 65 20 73 65 76 65  72 61 6c 20 69 6e 63 6f  |ave several inco|
00000fd0  6d 69 6e 67 20 4e 4e 54  50 20 63 6f 6e 6e 65 63  |ming NNTP connec|
00000fe0  74 69 6f 6e 73 20 61 74  20 6f 6e 63 65 2e 20 49  |tions at once. I|
00000ff0  74 20 69 73 20 6e 69 63  65 20 74 6f 0a 67 72 6f  |t is nice to.gro|
00001000  75 70 20 74 68 65 20 6c  6f 67 20 6d 65 73 73 61  |up the log messa|
00001010  67 65 73 20 74 68 61 74  20 61 72 65 20 63 6f 6d  |ges that are com|
00001020  69 6e 67 20 66 72 6f 6d  20 65 61 63 68 20 73 65  |ing from each se|
00001030  70 61 72 61 74 65 20 63  6f 6e 6e 65 63 74 69 6f  |parate connectio|
00001040  6e 0a 74 6f 67 65 74 68  65 72 2e 20 54 68 69 73  |n.together. This|
00001050  20 63 61 6e 20 62 65 20  64 6f 6e 65 20 75 73 69  | can be done usi|
00001060  6e 67 20 53 79 73 4c 6f  67 5f 4f 70 65 6e 53 65  |ng SysLog_OpenSe|
00001070  73 73 69 6f 6e 4c 6f 67  2e 0a 0a 53 79 73 4c 6f  |ssionLog...SysLo|
00001080  67 5f 4f 70 65 6e 53 65  73 73 69 6f 6e 4c 6f 67  |g_OpenSessionLog|
00001090  20 63 72 65 61 74 65 73  20 61 20 73 70 65 63 69  | creates a speci|
000010a0  61 6c 6c 79 2d 6e 61 6d  65 64 20 74 65 6d 70 6f  |ally-named tempo|
000010b0  72 61 72 79 20 6c 6f 67  20 66 69 6c 65 2e 20 54  |rary log file. T|
000010c0  68 65 20 6c 6f 67 0a 65  6e 74 72 69 65 73 20 66  |he log.entries f|
000010d0  6f 72 20 74 68 65 20 73  65 73 73 69 6f 6e 20 61  |or the session a|
000010e0  72 65 20 73 74 6f 72 65  64 20 69 6e 20 74 68 69  |re stored in thi|
000010f0  73 20 6c 6f 67 20 66 69  6c 65 2e 20 57 68 65 6e  |s log file. When|
00001100  20 74 68 65 20 74 65 6d  70 6f 72 61 72 79 20 6c  | the temporary l|
00001110  6f 67 0a 66 69 6c 65 20  69 73 20 63 6c 6f 73 65  |og.file is close|
00001120  64 20 75 73 69 6e 67 20  53 79 73 4c 6f 67 5f 43  |d using SysLog_C|
00001130  6c 6f 73 65 53 65 73 73  69 6f 6e 4c 6f 67 2c 20  |loseSessionLog, |
00001140  74 68 69 73 20 64 61 74  61 20 69 73 20 61 70 70  |this data is app|
00001150  65 6e 64 65 64 20 69 6e  20 6f 6e 65 0a 63 68 75  |ended in one.chu|
00001160  6e 6b 20 74 6f 20 74 68  65 20 65 6e 64 20 6f 66  |nk to the end of|
00001170  20 74 68 65 20 6d 61 69  6e 20 6c 6f 67 2e 0a 0a  | the main log...|
00001180  53 79 73 4c 6f 67 20 63  68 65 63 6b 73 20 66 6f  |SysLog checks fo|
00001190  72 20 73 74 72 61 79 20  74 65 6d 70 6f 72 61 72  |r stray temporar|
000011a0  79 20 6c 6f 67 20 66 69  6c 65 73 20 77 68 65 6e  |y log files when|
000011b0  20 69 74 20 69 6e 69 74  69 61 6c 69 73 65 73 20  | it initialises |
000011c0  61 6e 64 0a 66 69 6e 61  6c 69 73 65 73 2c 20 61  |and.finalises, a|
000011d0  6e 64 20 61 70 70 65 6e  64 73 20 74 68 65 6d 20  |nd appends them |
000011e0  74 6f 20 74 68 65 20 72  65 6c 65 76 61 6e 74 20  |to the relevant |
000011f0  6c 6f 67 73 2e 20 54 68  69 73 20 63 6f 70 65 73  |logs. This copes|
00001200  20 77 69 74 68 20 74 68  65 0a 73 69 74 75 61 74  | with the.situat|
00001210  69 6f 6e 20 77 68 65 72  65 20 61 6e 20 61 70 70  |ion where an app|
00001220  6c 69 63 61 74 69 6f 6e  20 63 72 61 73 68 65 73  |lication crashes|
00001230  20 6f 72 20 6f 74 68 65  72 77 69 73 65 20 65 78  | or otherwise ex|
00001240  69 74 73 20 77 69 74 68  6f 75 74 20 63 61 6c 6c  |its without call|
00001250  69 6e 67 0a 53 79 73 4c  6f 67 5f 43 6c 6f 73 65  |ing.SysLog_Close|
00001260  53 65 73 73 69 6f 6e 4c  6f 67 2e 0a 0a 0a 3d 3d  |SessionLog....==|
00001270  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
000012b0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 0a 50 72 69 6f 72  |==========.Prior|
000012c0  69 74 69 65 73 0a 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |ities.----------|
000012d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001310  2d 2d 0a 0a 4d 65 73 73  61 67 65 20 70 72 69 6f  |--..Message prio|
00001320  72 69 74 69 65 73 20 63  61 6e 20 62 65 20 69 6e  |rities can be in|
00001330  20 74 68 65 20 72 61 6e  67 65 20 30 20 74 6f 20  | the range 0 to |
00001340  32 35 35 2c 20 77 69 74  68 20 30 20 62 65 69 6e  |255, with 0 bein|
00001350  67 20 74 68 65 20 68 69  67 68 65 73 74 0a 70 72  |g the highest.pr|
00001360  69 6f 72 69 74 79 20 61  6e 64 20 32 35 35 20 62  |iority and 255 b|
00001370  65 69 6e 67 20 74 68 65  20 6c 6f 77 65 73 74 2e  |eing the lowest.|
00001380  20 55 6e 6c 65 73 73 20  6f 74 68 65 72 77 69 73  | Unless otherwis|
00001390  65 20 73 70 65 63 69 66  69 65 64 20 62 79 20 74  |e specified by t|
000013a0  68 65 20 75 73 65 72 2c  0a 6f 6e 6c 79 20 6d 65  |he user,.only me|
000013b0  73 73 61 67 65 73 20 77  69 74 68 20 70 72 69 6f  |ssages with prio|
000013c0  72 69 74 69 65 73 20 6f  66 20 6c 65 73 73 20 74  |rities of less t|
000013d0  68 61 6e 20 31 32 35 20  61 72 65 20 73 74 6f 72  |han 125 are stor|
000013e0  65 64 20 69 6e 20 74 68  65 20 6c 6f 67 20 66 69  |ed in the log fi|
000013f0  6c 65 73 2e 0a 59 6f 75  20 73 68 6f 75 6c 64 20  |les..You should |
00001400  74 68 65 72 65 66 6f 72  65 20 74 68 69 6e 6b 20  |therefore think |
00001410  61 62 6f 75 74 20 77 68  61 74 20 74 68 69 6e 67  |about what thing|
00001420  73 20 74 68 65 20 75 73  65 72 20 69 73 20 6c 69  |s the user is li|
00001430  6b 65 6c 79 20 74 6f 20  77 61 6e 74 20 74 6f 0a  |kely to want to.|
00001440  68 61 76 65 20 6c 6f 67  67 65 64 20 62 79 20 64  |have logged by d|
00001450  65 66 61 75 6c 74 2c 20  61 6e 64 20 65 6e 73 75  |efault, and ensu|
00001460  72 65 20 74 68 61 74 20  74 68 65 73 65 20 74 68  |re that these th|
00001470  69 6e 67 73 20 61 72 65  20 6c 6f 67 67 65 64 20  |ings are logged |
00001480  61 74 0a 61 20 70 72 69  6f 72 69 74 79 20 6f 66  |at.a priority of|
00001490  20 31 32 34 20 6f 72 20  6c 65 73 73 2e 0a 0a 54  | 124 or less...T|
000014a0  68 65 20 70 72 69 6f 72  69 74 79 20 6f 66 20 65  |he priority of e|
000014b0  72 72 6f 72 73 20 6f 66  74 65 6e 20 64 65 70 65  |rrors often depe|
000014c0  6e 64 73 20 6f 6e 20 68  6f 77 20 73 69 67 6e 69  |nds on how signi|
000014d0  66 69 63 61 6e 74 20 74  68 65 20 63 6f 6e 73 65  |ficant the conse|
000014e0  71 75 65 6e 63 65 73 20  6f 66 0a 74 68 65 20 65  |quences of.the e|
000014f0  72 72 6f 72 20 61 72 65  2c 20 6e 6f 74 20 77 68  |rror are, not wh|
00001500  61 74 20 74 68 65 20 63  61 75 73 65 20 6f 66 20  |at the cause of |
00001510  69 74 20 69 73 2e 20 65  2e 67 2e 20 73 6f 6d 65  |it is. e.g. some|
00001520  74 69 6d 65 73 20 22 6f  75 74 20 6f 66 20 6d 65  |times "out of me|
00001530  6d 6f 72 79 22 0a 77 69  6c 6c 20 62 65 20 61 6e  |mory".will be an|
00001540  20 65 78 74 72 65 6d 65  6c 79 20 69 6d 70 6f 72  | extremely impor|
00001550  74 61 6e 74 20 75 6e 72  65 63 6f 76 65 72 61 62  |tant unrecoverab|
00001560  6c 65 20 65 72 72 6f 72  20 28 62 65 63 61 75 73  |le error (becaus|
00001570  65 20 74 68 65 20 70 72  6f 67 72 61 6d 0a 63 61  |e the program.ca|
00001580  6e 27 74 20 73 74 61 72  74 20 75 70 29 2c 20 61  |n't start up), a|
00001590  6e 64 20 73 6f 6d 65 74  69 6d 65 73 20 69 74 20  |nd sometimes it |
000015a0  77 69 6c 6c 20 62 65 20  75 6e 69 6d 70 6f 72 74  |will be unimport|
000015b0  61 6e 74 20 28 62 65 63  61 75 73 65 20 74 68 65  |ant (because the|
000015c0  20 70 72 6f 67 72 61 6d  0a 63 61 6e 20 75 73 65  | program.can use|
000015d0  20 64 69 73 6b 20 69 6e  73 74 65 61 64 2c 20 6f  | disk instead, o|
000015e0  72 20 6d 61 79 62 65 20  74 72 79 20 61 67 61 69  |r maybe try agai|
000015f0  6e 20 6c 61 74 65 72 29  2e 0a 0a 0a 3d 3d 3d 3d  |n later)....====|
00001600  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00001640  3d 3d 3d 3d 3d 3d 3d 3d  0a 4c 6f 67 20 6e 61 6d  |========.Log nam|
00001650  65 73 0a 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |es.-------------|
00001660  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001690  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 0a  |---------------.|
000016a0  0a 4c 6f 67 20 6e 61 6d  65 73 20 61 72 65 20 75  |.Log names are u|
000016b0  73 65 64 20 61 73 20 74  68 65 20 6c 65 61 66 6e  |sed as the leafn|
000016c0  61 6d 65 73 20 74 6f 20  73 74 6f 72 65 20 74 68  |ames to store th|
000016d0  65 20 6c 6f 67 73 20 61  73 2c 20 73 6f 20 74 68  |e logs as, so th|
000016e0  65 79 20 6d 75 73 74 0a  63 6f 6d 70 6c 79 20 77  |ey must.comply w|
000016f0  69 74 68 20 74 68 65 20  72 75 6c 65 73 20 66 6f  |ith the rules fo|
00001700  72 20 52 49 53 43 20 4f  53 20 6c 65 61 66 6e 61  |r RISC OS leafna|
00001710  6d 65 73 2e 20 54 68 65  79 20 6d 75 73 74 20 61  |mes. They must a|
00001720  6c 73 6f 20 6e 6f 74 20  62 65 20 6c 6f 6e 67 65  |lso not be longe|
00001730  72 0a 74 68 61 6e 20 74  65 6e 20 63 68 61 72 61  |r.than ten chara|
00001740  63 74 65 72 73 2e 0a 0a  49 74 20 69 73 20 69 6e  |cters...It is in|
00001750  74 65 6e 64 65 64 20 74  68 61 74 20 65 61 63 68  |tended that each|
00001760  20 61 70 70 6c 69 63 61  74 69 6f 6e 20 68 61 76  | application hav|
00001770  65 20 69 74 73 20 6f 77  6e 20 6c 6f 67 2c 20 73  |e its own log, s|
00001780  6f 20 61 6e 20 6f 62 76  69 6f 75 73 20 63 68 6f  |o an obvious cho|
00001790  69 63 65 0a 66 6f 72 20  74 68 65 20 6c 6f 67 20  |ice.for the log |
000017a0  6e 61 6d 65 20 69 73 20  74 68 65 20 61 70 70 6c  |name is the appl|
000017b0  69 63 61 74 69 6f 6e 20  6e 61 6d 65 20 28 77 69  |ication name (wi|
000017c0  74 68 6f 75 74 20 74 68  65 20 27 21 27 29 2e 20  |thout the '!'). |
000017d0  56 65 72 79 20 6c 61 72  67 65 0a 61 70 70 6c 69  |Very large.appli|
000017e0  63 61 74 69 6f 6e 73 20  63 6f 75 6c 64 20 68 61  |cations could ha|
000017f0  76 65 20 6d 6f 72 65 20  74 68 61 6e 20 6f 6e 65  |ve more than one|
00001800  20 6c 6f 67 20 66 69 6c  65 20 2d 20 69 6e 20 77  | log file - in w|
00001810  68 69 63 68 20 63 61 73  65 20 74 68 65 20 6e 61  |hich case the na|
00001820  6d 69 6e 67 0a 73 63 68  65 6d 65 20 69 73 20 75  |ming.scheme is u|
00001830  6e 73 70 65 63 69 66 69  65 64 2e 20 54 72 79 20  |nspecified. Try |
00001840  61 6e 64 20 63 68 6f 6f  73 65 20 73 65 6e 73 69  |and choose sensi|
00001850  62 6c 65 20 6c 6f 67 20  6e 61 6d 65 73 2e 0a 0a  |ble log names...|
00001860  49 66 20 79 6f 75 72 20  61 70 70 6c 69 63 61 74  |If your applicat|
00001870  69 6f 6e 20 69 73 20 67  6f 69 6e 67 20 74 6f 20  |ion is going to |
00001880  62 65 20 64 69 73 74 72  69 62 75 74 65 64 2c 20  |be distributed, |
00001890  79 6f 75 20 73 68 6f 75  6c 64 20 77 72 69 74 65  |you should write|
000018a0  20 74 6f 0a 73 75 70 70  6f 72 74 40 64 6f 67 67  | to.support@dogg|
000018b0  79 73 6f 66 74 2e 63 6f  2e 75 6b 2c 20 74 6f 20  |ysoft.co.uk, to |
000018c0  72 65 71 75 65 73 74 20  74 68 61 74 20 79 6f 75  |request that you|
000018d0  72 20 6c 6f 67 20 6e 61  6d 65 20 62 65 20 66 6f  |r log name be fo|
000018e0  72 6d 61 6c 6c 79 0a 61  6c 6c 6f 63 61 74 65 64  |rmally.allocated|
000018f0  2e 20 54 68 69 73 20 77  69 6c 6c 20 68 6f 70 65  |. This will hope|
00001900  66 75 6c 6c 79 20 61 76  6f 69 64 20 68 61 76 69  |fully avoid havi|
00001910  6e 67 20 6d 6f 72 65 20  74 68 61 6e 20 6f 6e 65  |ng more than one|
00001920  20 70 72 6f 67 72 61 6d  20 75 73 69 6e 67 20 74  | program using t|
00001930  68 65 0a 73 61 6d 65 20  6c 6f 67 20 66 69 6c 65  |he.same log file|
00001940  2e 0a 0a 54 68 65 20 66  6f 6c 6c 6f 77 69 6e 67  |...The following|
00001950  20 6c 6f 67 20 6e 61 6d  65 73 20 61 72 65 20 72  | log names are r|
00001960  65 73 65 72 76 65 64 20  66 6f 72 20 69 6e 74 65  |eserved for inte|
00001970  72 6e 61 6c 20 75 73 65  3a 0a 0a 20 20 61 6e 79  |rnal use:..  any|
00001980  20 6e 61 6d 65 20 62 65  67 69 6e 6e 69 6e 67 20  | name beginning |
00001990  77 69 74 68 20 61 20 27  2d 27 20 63 68 61 72 61  |with a '-' chara|
000019a0  63 74 65 72 0a 20 20 61  6e 79 20 6e 61 6d 65 20  |cter.  any name |
000019b0  62 65 67 69 6e 6e 69 6e  67 20 77 69 74 68 20 22  |beginning with "|
000019c0  53 79 73 4c 6f 67 22 0a  20 20 22 4f 6c 64 22 0a  |SysLog".  "Old".|
000019d0  0a 0a 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |..==============|
000019e0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00001a10  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 0a 4f  |==============.O|
00001a20  53 20 63 6f 6d 6d 61 6e  64 73 0a 2d 2d 2d 2d 2d  |S commands.-----|
00001a30  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001a70  2d 2d 2d 2d 2d 2d 2d 0a  0a 2a 53 79 73 4c 6f 67  |-------..*SysLog|
00001a80  20 3c 6c 6f 67 20 6e 61  6d 65 3e 20 3c 70 72 69  | <log name> <pri|
00001a90  6f 72 69 74 79 3e 20 3c  6d 65 73 73 61 67 65 3e  |ority> <message>|
00001aa0  0a 20 2d 2d 2d 2d 2d 2d  0a 0a 41 64 64 73 20 61  |. ------..Adds a|
00001ab0  20 74 69 6d 65 2d 73 74  61 6d 70 65 64 20 6d 65  | time-stamped me|
00001ac0  73 73 61 67 65 20 74 6f  20 74 68 65 20 6c 6f 67  |ssage to the log|
00001ad0  20 66 69 6c 65 2c 20 69  66 20 61 6e 64 20 6f 6e  | file, if and on|
00001ae0  6c 79 20 69 66 20 74 68  65 20 73 70 65 63 69 66  |ly if the specif|
00001af0  69 65 64 0a 6c 6f 67 20  66 69 6c 65 20 69 73 20  |ied.log file is |
00001b00  73 65 74 20 75 70 20 74  6f 20 6c 6f 67 20 6d 65  |set up to log me|
00001b10  73 73 61 67 65 73 20 6f  66 20 74 68 69 73 20 70  |ssages of this p|
00001b20  72 69 6f 72 69 74 79 2e  20 54 68 65 20 70 72 69  |riority. The pri|
00001b30  6f 72 69 74 79 20 6d 75  73 74 20 62 65 20 69 6e  |ority must be in|
00001b40  0a 74 68 65 20 72 61 6e  67 65 20 30 2d 32 35 35  |.the range 0-255|
00001b50  2e 0a 0a 0a 2a 53 79 73  4c 6f 67 20 3c 6c 6f 67  |....*SysLog <log|
00001b60  20 6e 61 6d 65 3e 20 3c  6e 65 77 20 70 72 69 6f  | name> <new prio|
00001b70  72 69 74 79 3e 0a 20 2d  2d 2d 2d 2d 2d 0a 0a 54  |rity>. ------..T|
00001b80  65 6d 70 6f 72 61 72 69  6c 79 20 28 62 75 74 20  |emporarily (but |
00001b90  77 69 74 68 20 69 6d 6d  65 64 69 61 74 65 20 65  |with immediate e|
00001ba0  66 66 65 63 74 29 20 63  68 61 6e 67 65 73 20 74  |ffect) changes t|
00001bb0  68 65 20 6c 6f 67 67 69  6e 67 20 70 72 69 6f 72  |he logging prior|
00001bc0  69 74 79 20 6f 66 20 74  68 65 0a 73 70 65 63 69  |ity of the.speci|
00001bd0  66 69 65 64 20 6c 6f 67  2e 20 54 68 65 20 70 72  |fied log. The pr|
00001be0  69 6f 72 69 74 79 20 6d  75 73 74 20 62 65 20 69  |iority must be i|
00001bf0  6e 20 74 68 65 20 72 61  6e 67 65 20 30 2d 32 35  |n the range 0-25|
00001c00  36 2e 0a 0a 0a 2a 53 79  73 4c 6f 67 20 4f 4e 7c  |6....*SysLog ON||
00001c10  4f 46 46 0a 20 2d 2d 2d  2d 2d 2d 0a 0a 2a 53 79  |OFF. ------..*Sy|
00001c20  73 4c 6f 67 20 4f 46 46  20 77 69 6c 6c 20 74 65  |sLog OFF will te|
00001c30  6d 70 6f 72 61 72 79 20  64 69 73 61 62 6c 65 20  |mporary disable |
00001c40  53 79 73 4c 6f 67 20 2d  20 61 6c 6c 20 6c 6f 67  |SysLog - all log|
00001c50  20 6d 65 73 73 61 67 65  73 20 72 65 63 65 69 76  | messages receiv|
00001c60  65 64 20 61 66 74 65 72  0a 74 68 69 73 20 63 6f  |ed after.this co|
00001c70  6d 6d 61 6e 64 20 69 73  20 69 73 73 75 65 64 20  |mmand is issued |
00001c80  77 69 6c 6c 20 62 65 20  69 67 6e 6f 72 65 64 2e  |will be ignored.|
00001c90  20 2a 53 79 73 4c 6f 67  20 4f 4e 20 72 65 73 75  | *SysLog ON resu|
00001ca0  6d 65 73 20 6e 6f 72 6d  61 6c 20 6f 70 65 72 61  |mes normal opera|
00001cb0  74 69 6f 6e 2e 0a 0a 0a  2a 53 79 73 4c 6f 67 5f  |tion....*SysLog_|
00001cc0  46 6c 75 73 68 20 4f 4e  7c 4f 46 46 0a 20 2d 2d  |Flush ON|OFF. --|
00001cd0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0a 0a 2a 53 79 73  |----------..*Sys|
00001ce0  4c 6f 67 5f 46 6c 75 73  68 20 77 69 74 68 20 6e  |Log_Flush with n|
00001cf0  6f 20 70 61 72 61 6d 61  74 65 72 73 20 66 6c 75  |o paramaters flu|
00001d00  73 68 65 73 20 61 6c 6c  20 63 75 72 72 65 6e 74  |shes all current|
00001d10  6c 79 20 6f 70 65 6e 20  6c 6f 67 20 66 69 6c 65  |ly open log file|
00001d20  73 20 74 6f 0a 64 69 73  6b 2e 20 49 66 20 69 74  |s to.disk. If it|
00001d30  20 75 73 65 64 20 77 69  74 68 20 74 68 65 20 70  | used with the p|
00001d40  61 72 61 6d 65 74 65 72  20 27 4f 4e 27 20 74 68  |arameter 'ON' th|
00001d50  65 6e 20 69 74 20 63 61  75 73 65 73 20 61 6c 6c  |en it causes all|
00001d60  20 6c 6f 67 20 66 69 6c  65 73 20 74 6f 20 62 65  | log files to be|
00001d70  0a 66 6c 75 73 68 65 64  20 69 6d 6d 65 64 69 61  |.flushed immedia|
00001d80  74 65 6c 79 20 61 66 74  65 72 20 65 61 63 68 20  |tely after each |
00001d90  6d 65 73 73 61 67 65 20  69 73 20 77 72 69 74 74  |message is writt|
00001da0  65 6e 20 74 6f 20 74 68  65 6d 2e 20 2a 53 79 73  |en to them. *Sys|
00001db0  4c 6f 67 5f 46 6c 75 73  68 20 4f 46 46 0a 64 69  |Log_Flush OFF.di|
00001dc0  73 61 62 6c 65 73 20 74  68 69 73 20 62 65 68 61  |sables this beha|
00001dd0  76 69 6f 75 72 2e 20 28  54 68 69 73 20 69 73 20  |viour. (This is |
00001de0  69 6e 74 65 6e 64 65 64  20 66 6f 72 20 75 73 65  |intended for use|
00001df0  20 77 68 65 6e 20 74 68  65 20 61 20 70 72 6f 67  | when the a prog|
00001e00  72 61 6d 20 69 73 0a 62  65 69 6e 67 20 64 65 62  |ram is.being deb|
00001e10  75 67 67 65 64 2c 20 61  6e 64 20 6b 65 65 70 73  |ugged, and keeps|
00001e20  20 63 72 61 73 68 69 6e  67 20 74 68 65 20 63 6f  | crashing the co|
00001e30  6d 70 75 74 65 72 2e 20  57 69 74 68 20 53 79 73  |mputer. With Sys|
00001e40  4c 6f 67 5f 46 6c 75 73  68 20 4f 4e 2c 0a 79 6f  |Log_Flush ON,.yo|
00001e50  75 27 72 65 20 67 75 61  72 61 6e 74 65 65 64 20  |u're guaranteed |
00001e60  74 68 61 74 20 61 6c 6c  20 74 68 65 20 6c 6f 67  |that all the log|
00001e70  20 69 6e 66 6f 72 6d 61  74 69 6f 6e 20 79 6f 75  | information you|
00001e80  72 20 70 72 6f 67 72 61  6d 20 70 72 6f 64 75 63  |r program produc|
00001e90  65 73 20 62 65 66 6f 72  65 0a 69 74 20 63 72 61  |es before.it cra|
00001ea0  73 68 65 73 20 77 69 6c  6c 20 61 63 74 75 61 6c  |shes will actual|
00001eb0  6c 79 20 62 65 20 61 76  61 69 6c 61 62 6c 65 20  |ly be available |
00001ec0  61 66 74 65 72 20 61 20  72 65 2d 62 6f 6f 74 2e  |after a re-boot.|
00001ed0  20 49 74 20 61 6c 73 6f  20 6d 61 6b 65 73 20 6c  | It also makes l|
00001ee0  6f 67 67 69 6e 67 0a 2a  76 65 72 79 20 73 6c 6f  |ogging.*very slo|
00001ef0  77 2a 2e 29 0a 0a 0a 3d  3d 3d 3d 3d 3d 3d 3d 3d  |w*.)...=========|
00001f00  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00001f40  3d 3d 3d 0a 53 57 49 73  0a 2d 2d 2d 2d 2d 2d 2d  |===.SWIs.-------|
00001f50  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001f90  2d 2d 2d 2d 2d 0a 0a 53  79 73 4c 6f 67 5f 4c 6f  |-----..SysLog_Lo|
00001fa0  67 4d 65 73 73 61 67 65  20 28 26 34 43 38 38 30  |gMessage (&4C880|
00001fb0  29 0a 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |).--------------|
00001fc0  2d 2d 2d 0a 52 30 2d 3e  20 6c 6f 67 20 6e 61 6d  |---.R0-> log nam|
00001fd0  65 2c 20 6f 72 20 3d 20  73 65 73 73 69 6f 6e 20  |e, or = session |
00001fe0  6c 6f 67 20 68 61 6e 64  6c 65 0a 52 31 2d 3e 20  |log handle.R1-> |
00001ff0  74 65 78 74 20 74 6f 20  6c 6f 67 0a 52 32 20 3d  |text to log.R2 =|
00002000  20 70 72 69 6f 72 69 74  79 0a 0a 41 64 64 73 20  | priority..Adds |
00002010  61 20 74 69 6d 65 2d 73  74 61 6d 70 65 64 20 6d  |a time-stamped m|
00002020  65 73 73 61 67 65 20 74  6f 20 74 68 65 20 6c 6f  |essage to the lo|
00002030  67 20 66 69 6c 65 2c 20  69 66 20 61 6e 64 20 6f  |g file, if and o|
00002040  6e 6c 79 20 69 66 20 74  68 65 20 73 70 65 63 69  |nly if the speci|
00002050  66 69 65 64 0a 6c 6f 67  20 66 69 6c 65 20 69 73  |fied.log file is|
00002060  20 73 65 74 20 75 70 20  74 6f 20 6c 6f 67 20 6d  | set up to log m|
00002070  65 73 73 61 67 65 73 20  6f 66 20 74 68 69 73 20  |essages of this |
00002080  70 72 69 6f 72 69 74 79  2e 20 54 68 65 20 74 65  |priority. The te|
00002090  78 74 20 74 6f 20 6c 6f  67 20 6d 75 73 74 0a 6e  |xt to log must.n|
000020a0  6f 74 20 62 65 20 6c 6f  6e 67 65 72 20 74 68 61  |ot be longer tha|
000020b0  6e 20 31 30 32 34 20 62  79 74 65 73 2e 20 54 68  |n 1024 bytes. Th|
000020c0  65 20 70 72 69 6f 72 69  74 79 20 6d 75 73 74 20  |e priority must |
000020d0  62 65 20 69 6e 20 74 68  65 20 72 61 6e 67 65 20  |be in the range |
000020e0  30 2d 32 35 35 2e 0a 0a  0a 53 79 73 4c 6f 67 5f  |0-255....SysLog_|
000020f0  47 65 74 4c 6f 67 4c 65  76 65 6c 20 28 26 34 43  |GetLogLevel (&4C|
00002100  38 38 31 29 0a 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |881).-----------|
00002110  2d 2d 2d 2d 2d 2d 2d 0a  52 30 2d 3e 20 6c 6f 67  |-------.R0-> log|
00002120  20 6e 61 6d 65 2c 20 6f  72 20 3d 20 73 65 73 73  | name, or = sess|
00002130  69 6f 6e 20 6c 6f 67 20  68 61 6e 64 6c 65 0a 65  |ion log handle.e|
00002140  78 69 74 3a 0a 52 30 20  3d 20 70 72 69 6f 72 69  |xit:.R0 = priori|
00002150  74 79 0a 0a 52 65 61 64  73 20 74 68 65 20 6c 6f  |ty..Reads the lo|
00002160  67 67 69 6e 67 20 6c 65  76 65 6c 20 66 6f 72 20  |gging level for |
00002170  74 68 65 20 73 70 65 63  69 66 69 65 64 20 6c 6f  |the specified lo|
00002180  67 2e 20 4d 65 73 73 61  67 65 73 20 6f 66 20 2a  |g. Messages of *|
00002190  6c 65 73 73 20 74 68 61  6e 2a 20 74 68 65 0a 72  |less than* the.r|
000021a0  65 74 75 72 6e 65 64 20  70 72 69 6f 72 69 74 79  |eturned priority|
000021b0  20 61 72 65 20 62 65 69  6e 67 20 6c 6f 67 67 65  | are being logge|
000021c0  64 2e 20 54 68 69 73 20  63 61 6e 20 62 65 20 75  |d. This can be u|
000021d0  73 65 64 20 74 6f 20 61  76 6f 69 64 20 63 72 65  |sed to avoid cre|
000021e0  61 74 69 6f 6e 20 6f 66  0a 6c 6f 67 67 69 6e 67  |ation of.logging|
000021f0  20 69 6e 66 6f 72 6d 61  74 69 6f 6e 20 74 68 61  | information tha|
00002200  74 20 69 73 20 6f 6e 6c  79 20 67 6f 69 6e 67 20  |t is only going |
00002210  74 6f 20 62 65 20 64 69  73 63 61 72 64 65 64 20  |to be discarded |
00002220  62 79 20 53 79 73 4c 6f  67 5f 4c 6f 67 4d 65 73  |by SysLog_LogMes|
00002230  73 61 67 65 0a 61 6e 79  77 61 79 2e 20 49 6e 20  |sage.anyway. In |
00002240  73 6f 6d 65 20 63 61 73  65 73 20 69 74 20 63 6f  |some cases it co|
00002250  75 6c 64 20 65 76 65 6e  20 62 65 20 75 73 65 64  |uld even be used|
00002260  20 74 6f 20 64 65 63 69  64 65 20 77 68 69 63 68  | to decide which|
00002270  20 76 65 72 73 69 6f 6e  20 6f 66 0a 61 20 70 72  | version of.a pr|
00002280  6f 67 72 61 6d 20 74 6f  20 6c 6f 61 64 20 28 65  |ogram to load (e|
00002290  2e 67 2e 20 77 68 65 74  68 65 72 20 74 6f 20 6c  |.g. whether to l|
000022a0  6f 61 64 20 61 20 64 65  62 75 67 67 69 6e 67 20  |oad a debugging |
000022b0  76 65 72 73 69 6f 6e 20  6f 66 20 54 65 72 6d 69  |version of Termi|
000022c0  74 65 49 50 29 2e 0a 0a  0a 53 79 73 4c 6f 67 5f  |teIP)....SysLog_|
000022d0  46 6c 75 73 68 4c 6f 67  20 28 26 34 43 38 38 32  |FlushLog (&4C882|
000022e0  29 0a 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |).--------------|
000022f0  2d 0a 52 30 2d 3e 20 6c  6f 67 20 6e 61 6d 65 2c  |-.R0-> log name,|
00002300  20 6f 72 20 3d 20 73 65  73 73 69 6f 6e 20 6c 6f  | or = session lo|
00002310  67 20 68 61 6e 64 6c 65  2c 20 6f 72 20 3d 20 30  |g handle, or = 0|
00002320  20 74 6f 20 66 6c 75 73  68 20 61 6c 6c 20 6c 6f  | to flush all lo|
00002330  67 73 0a 0a 45 6e 73 75  72 65 73 20 74 68 65 20  |gs..Ensures the |
00002340  73 70 65 63 69 66 69 65  64 20 6c 6f 67 20 28 6f  |specified log (o|
00002350  72 20 61 6c 6c 20 6c 6f  67 73 29 20 61 72 65 20  |r all logs) are |
00002360  66 75 6c 6c 79 20 77 72  69 74 74 65 6e 20 74 6f  |fully written to|
00002370  20 64 69 73 6b 2c 20 61  6e 64 20 74 68 65 0a 66  | disk, and the.f|
00002380  69 6c 65 73 20 63 6c 6f  73 65 64 2e 20 54 68 69  |iles closed. Thi|
00002390  73 20 63 61 6e 20 62 65  20 75 73 65 66 75 6c 20  |s can be useful |
000023a0  74 6f 20 6d 61 6b 65 20  73 75 72 65 20 74 68 61  |to make sure tha|
000023b0  74 20 74 68 65 20 75 73  65 72 20 69 73 20 69 6d  |t the user is im|
000023c0  6d 65 64 69 61 74 65 6c  79 0a 61 62 6c 65 20 74  |mediately.able t|
000023d0  6f 20 72 65 61 64 20 64  61 74 61 20 74 68 61 74  |o read data that|
000023e0  20 68 61 73 20 6a 75 73  74 20 62 65 65 6e 20 77  | has just been w|
000023f0  72 69 74 74 65 6e 20 74  6f 20 74 68 65 20 6c 6f  |ritten to the lo|
00002400  67 2e 0a 0a 0a 53 79 73  4c 6f 67 5f 53 65 74 4c  |g....SysLog_SetL|
00002410  6f 67 4c 65 76 65 6c 20  28 26 34 43 38 38 33 29  |ogLevel (&4C883)|
00002420  0a 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.---------------|
00002430  2d 2d 2d 0a 52 30 2d 3e  20 6c 6f 67 20 6e 61 6d  |---.R0-> log nam|
00002440  65 2c 20 6f 72 20 3d 20  73 65 73 73 69 6f 6e 20  |e, or = session |
00002450  6c 6f 67 20 68 61 6e 64  6c 65 0a 52 31 20 3d 20  |log handle.R1 = |
00002460  6e 65 77 20 6c 6f 67 67  69 6e 67 20 6c 65 76 65  |new logging leve|
00002470  6c 0a 0a 53 65 74 73 20  74 68 65 20 6c 6f 67 67  |l..Sets the logg|
00002480  69 6e 67 20 6c 65 76 65  6c 20 66 6f 72 20 74 68  |ing level for th|
00002490  65 20 73 70 65 63 69 66  69 65 64 20 6c 6f 67 2e  |e specified log.|
000024a0  20 54 68 69 73 20 53 57  49 20 69 73 20 70 72 6f  | This SWI is pro|
000024b0  76 69 64 65 64 20 66 6f  72 0a 64 65 62 75 67 67  |vided for.debugg|
000024c0  69 6e 67 20 61 6e 64 20  69 6e 74 65 72 6e 61 6c  |ing and internal|
000024d0  20 75 73 65 20 6f 6e 6c  79 2c 20 61 6e 64 20 53  | use only, and S|
000024e0  48 4f 55 4c 44 20 4e 4f  54 20 42 45 20 55 53 45  |HOULD NOT BE USE|
000024f0  44 20 69 6e 20 64 69 73  74 72 69 62 75 74 69 6f  |D in distributio|
00002500  6e 0a 63 6f 64 65 2e 20  54 68 65 20 6c 6f 67 67  |n.code. The logg|
00002510  69 6e 67 20 6c 65 76 65  6c 20 69 73 20 74 68 65  |ing level is the|
00002520  20 75 73 65 72 27 73 20  64 65 63 69 73 69 6f 6e  | user's decision|
00002530  2c 20 6e 6f 74 20 74 68  65 20 70 72 6f 67 72 61  |, not the progra|
00002540  6d 6d 65 72 27 73 2e 0a  0a 0a 53 79 73 4c 6f 67  |mmer's....SysLog|
00002550  5f 4c 6f 67 55 6e 73 74  61 6d 70 65 64 20 28 26  |_LogUnstamped (&|
00002560  34 43 38 38 34 29 0a 2d  2d 2d 2d 2d 2d 2d 2d 2d  |4C884).---------|
00002570  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0a 52 30 2d 3e 20  |----------.R0-> |
00002580  6c 6f 67 20 6e 61 6d 65  2c 20 6f 72 20 3d 20 73  |log name, or = s|
00002590  65 73 73 69 6f 6e 20 6c  6f 67 20 68 61 6e 64 6c  |ession log handl|
000025a0  65 0a 52 31 2d 3e 20 74  65 78 74 20 74 6f 20 6c  |e.R1-> text to l|
000025b0  6f 67 0a 52 32 20 3d 20  70 72 69 6f 72 69 74 79  |og.R2 = priority|
000025c0  0a 0a 41 64 64 73 20 61  20 6d 65 73 73 61 67 65  |..Adds a message|
000025d0  20 74 6f 20 74 68 65 20  6c 6f 67 20 66 69 6c 65  | to the log file|
000025e0  2c 20 69 66 20 61 6e 64  20 6f 6e 6c 79 20 69 66  |, if and only if|
000025f0  20 74 68 65 20 73 70 65  63 69 66 69 65 64 20 6c  | the specified l|
00002600  6f 67 20 66 69 6c 65 20  69 73 20 73 65 74 0a 74  |og file is set.t|
00002610  6f 20 6c 6f 67 20 6d 65  73 73 61 67 65 73 20 6f  |o log messages o|
00002620  66 20 74 68 69 73 20 70  72 69 6f 72 69 74 79 2e  |f this priority.|
00002630  20 54 68 65 20 74 65 78  74 20 74 6f 20 6c 6f 67  | The text to log|
00002640  20 6d 75 73 74 20 6e 6f  74 20 62 65 20 6c 6f 6e  | must not be lon|
00002650  67 65 72 20 74 68 61 6e  0a 31 30 32 34 20 62 79  |ger than.1024 by|
00002660  74 65 73 2e 20 54 68 65  20 70 72 69 6f 72 69 74  |tes. The priorit|
00002670  79 20 6d 75 73 74 20 62  65 20 69 6e 20 74 68 65  |y must be in the|
00002680  20 72 61 6e 67 65 20 30  2d 32 35 35 2e 20 49 74  | range 0-255. It|
00002690  20 69 73 20 72 65 63 6f  6d 6d 65 6e 64 65 64 20  | is recommended |
000026a0  74 68 61 74 0a 79 6f 75  20 75 73 65 20 53 79 73  |that.you use Sys|
000026b0  4c 6f 67 5f 4c 6f 67 4d  65 73 73 61 67 65 20 66  |Log_LogMessage f|
000026c0  6f 72 20 61 6c 6c 20 6e  6f 72 6d 61 6c 20 6c 6f  |or all normal lo|
000026d0  67 20 65 6e 74 72 69 65  73 2e 0a 0a 0a 53 79 73  |g entries....Sys|
000026e0  4c 6f 67 5f 49 6e 64 65  6e 74 20 28 26 34 43 38  |Log_Indent (&4C8|
000026f0  38 35 29 0a 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |85).------------|
00002700  2d 0a 52 30 2d 3e 20 6c  6f 67 20 6e 61 6d 65 2c  |-.R0-> log name,|
00002710  20 6f 72 20 3d 20 73 65  73 73 69 6f 6e 20 6c 6f  | or = session lo|
00002720  67 20 68 61 6e 64 6c 65  0a 0a 49 6e 63 72 65 6d  |g handle..Increm|
00002730  65 6e 74 73 20 74 68 65  20 6c 6f 67 20 69 6e 64  |ents the log ind|
00002740  65 6e 74 20 6c 65 76 65  6c 2e 20 49 6e 20 6c 6f  |ent level. In lo|
00002750  67 20 6c 69 6e 65 73 20  67 65 6e 65 72 61 74 65  |g lines generate|
00002760  64 20 62 79 0a 53 79 73  4c 6f 67 5f 4c 6f 67 4d  |d by.SysLog_LogM|
00002770  65 73 73 61 67 65 2c 20  74 68 65 72 65 20 61 72  |essage, there ar|
00002780  65 20 3c 69 6e 64 65 6e  74 5f 6c 65 76 65 6c 20  |e <indent_level |
00002790  2b 20 31 3e 20 73 70 61  63 65 73 20 69 6e 20 62  |+ 1> spaces in b|
000027a0  65 74 77 65 65 6e 20 74  68 65 0a 70 72 69 6f 72  |etween the.prior|
000027b0  69 74 79 20 61 6e 64 20  74 68 65 20 6d 65 73 73  |ity and the mess|
000027c0  61 67 65 2e 20 54 68 69  73 20 63 61 6e 20 62 65  |age. This can be|
000027d0  20 75 73 65 66 75 6c 20  74 6f 20 73 68 6f 77 20  | useful to show |
000027e0  74 68 65 20 68 69 65 72  61 72 63 68 79 20 6f 66  |the hierarchy of|
000027f0  20 74 68 65 0a 66 75 6e  63 74 69 6f 6e 73 20 77  | the.functions w|
00002800  68 69 63 68 20 61 72 65  20 70 72 6f 64 75 63 69  |hich are produci|
00002810  6e 67 20 6c 6f 67 67 69  6e 67 20 6f 75 74 70 75  |ng logging outpu|
00002820  74 2e 20 54 68 65 20 69  6e 64 65 6e 74 20 6c 65  |t. The indent le|
00002830  76 65 6c 20 69 73 20 69  6e 69 74 69 61 6c 6c 79  |vel is initially|
00002840  0a 7a 65 72 6f 2e 0a 0a  0a 53 79 73 4c 6f 67 5f  |.zero....SysLog_|
00002850  55 6e 49 6e 64 65 6e 74  20 28 26 34 43 38 38 36  |UnIndent (&4C886|
00002860  29 0a 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |).--------------|
00002870  2d 0a 52 30 2d 3e 20 6c  6f 67 20 6e 61 6d 65 2c  |-.R0-> log name,|
00002880  20 6f 72 20 3d 20 73 65  73 73 69 6f 6e 20 6c 6f  | or = session lo|
00002890  67 20 68 61 6e 64 6c 65  0a 0a 44 65 63 72 65 6d  |g handle..Decrem|
000028a0  65 6e 74 73 20 74 68 65  20 6c 6f 67 20 69 6e 64  |ents the log ind|
000028b0  65 6e 74 20 6c 65 76 65  6c 2e 20 28 49 66 20 69  |ent level. (If i|
000028c0  74 20 69 73 20 7a 65 72  6f 20 69 74 20 69 73 20  |t is zero it is |
000028d0  6e 6f 74 20 64 65 63 72  65 6d 65 6e 74 65 64 2e  |not decremented.|
000028e0  29 0a 0a 0a 53 79 73 4c  6f 67 5f 4e 6f 49 6e 64  |)...SysLog_NoInd|
000028f0  65 6e 74 20 28 26 34 43  38 38 37 29 0a 2d 2d 2d  |ent (&4C887).---|
00002900  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 0a 52 30 2d  |------------.R0-|
00002910  3e 20 6c 6f 67 20 6e 61  6d 65 2c 20 6f 72 20 3d  |> log name, or =|
00002920  20 73 65 73 73 69 6f 6e  20 6c 6f 67 20 68 61 6e  | session log han|
00002930  64 6c 65 0a 0a 53 65 74  73 20 74 68 65 20 6c 6f  |dle..Sets the lo|
00002940  67 20 69 6e 64 65 6e 74  20 6c 65 76 65 6c 20 74  |g indent level t|
00002950  6f 20 7a 65 72 6f 2e 20  54 68 69 73 20 73 68 6f  |o zero. This sho|
00002960  75 6c 64 20 62 65 20 63  61 6c 6c 65 64 20 77 68  |uld be called wh|
00002970  65 6e 20 79 6f 75 72 20  70 72 6f 67 72 61 6d 0a  |en your program.|
00002980  6c 6f 61 64 73 2c 20 69  66 20 79 6f 75 20 61 72  |loads, if you ar|
00002990  65 20 75 73 69 6e 67 20  53 79 73 4c 6f 67 5f 49  |e using SysLog_I|
000029a0  6e 64 65 6e 74 2f 55 6e  49 6e 64 65 6e 74 2e 0a  |ndent/UnIndent..|
000029b0  0a 0a 53 79 73 4c 6f 67  5f 4f 70 65 6e 53 65 73  |..SysLog_OpenSes|
000029c0  73 69 6f 6e 4c 6f 67 20  28 26 34 43 38 38 38 29  |sionLog (&4C888)|
000029d0  0a 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.---------------|
000029e0  2d 2d 2d 2d 2d 2d 0a 52  30 2d 3e 20 6c 6f 67 20  |------.R0-> log |
000029f0  6e 61 6d 65 0a 52 31 20  3d 20 70 72 69 6f 72 69  |name.R1 = priori|
00002a00  74 79 0a 65 78 69 74 3a  0a 52 30 20 3d 20 73 65  |ty.exit:.R0 = se|
00002a10  73 73 69 6f 6e 20 6c 6f  67 20 68 61 6e 64 6c 65  |ssion log handle|
00002a20  20 28 6f 72 20 30 29 0a  0a 43 72 65 61 74 65 73  | (or 0)..Creates|
00002a30  20 61 20 74 65 6d 70 6f  72 61 72 79 20 73 65 73  | a temporary ses|
00002a40  73 69 6f 6e 20 6c 6f 67  20 66 69 6c 65 2e 20 57  |sion log file. W|
00002a50  68 65 6e 20 74 68 65 20  73 65 73 73 69 6f 6e 20  |hen the session |
00002a60  6c 6f 67 20 69 73 20 63  6c 6f 73 65 64 20 28 75  |log is closed (u|
00002a70  73 69 6e 67 0a 53 79 73  4c 6f 67 5f 43 6c 6f 73  |sing.SysLog_Clos|
00002a80  65 53 65 73 73 69 6f 6e  4c 6f 67 2c 20 62 65 6c  |eSessionLog, bel|
00002a90  6f 77 29 2c 20 74 68 65  20 73 65 73 73 69 6f 6e  |ow), the session|
00002aa0  20 6c 6f 67 20 69 73 20  61 70 70 65 6e 64 65 64  | log is appended|
00002ab0  20 74 6f 20 74 68 65 20  6d 61 69 6e 20 6c 6f 67  | to the main log|
00002ac0  0a 61 73 20 73 70 65 63  69 66 69 65 64 20 69 6e  |.as specified in|
00002ad0  20 52 30 20 6f 6e 20 65  6e 74 72 79 20 74 6f 20  | R0 on entry to |
00002ae0  74 68 69 73 20 53 57 49  2e 20 49 66 20 74 68 65  |this SWI. If the|
00002af0  20 6d 61 69 6e 20 6c 6f  67 20 69 73 20 73 65 74  | main log is set|
00002b00  20 74 6f 20 69 67 6e 6f  72 65 0a 6c 6f 67 20 65  | to ignore.log e|
00002b10  6e 74 72 69 65 73 20 6f  66 20 74 68 65 20 70 72  |ntries of the pr|
00002b20  69 6f 72 69 74 79 20 73  70 65 63 69 66 69 65 64  |iority specified|
00002b30  20 74 68 65 6e 20 7a 65  72 6f 20 77 69 6c 6c 20  | then zero will |
00002b40  62 65 20 72 65 74 75 72  6e 65 64 20 66 6f 72 20  |be returned for |
00002b50  74 68 65 0a 73 65 73 73  69 6f 6e 20 6c 6f 67 20  |the.session log |
00002b60  68 61 6e 64 6c 65 2e 20  54 68 69 73 20 64 6f 65  |handle. This doe|
00002b70  73 20 6e 6f 74 20 6e 65  63 65 73 73 61 72 69 6c  |s not necessaril|
00002b80  79 20 72 65 71 75 69 72  65 20 73 70 65 63 69 61  |y require specia|
00002b90  6c 20 63 61 73 65 20 63  6f 64 65 2c 20 61 73 0a  |l case code, as.|
00002ba0  6f 74 68 65 72 20 53 57  49 73 20 77 68 69 63 68  |other SWIs which|
00002bb0  20 61 63 63 65 70 74 20  73 65 73 73 69 6f 6e 20  | accept session |
00002bc0  6c 6f 67 20 68 61 6e 64  6c 65 73 20 77 69 6c 6c  |log handles will|
00002bd0  20 61 63 63 65 70 74 20  61 20 68 61 6e 64 6c 65  | accept a handle|
00002be0  20 6f 66 20 7a 65 72 6f  20 61 6e 64 0a 64 6f 20  | of zero and.do |
00002bf0  6e 6f 74 68 69 6e 67 2e  0a 0a 0a 53 79 73 4c 6f  |nothing....SysLo|
00002c00  67 5f 43 6c 6f 73 65 53  65 73 73 69 6f 6e 4c 6f  |g_CloseSessionLo|
00002c10  67 20 28 26 34 43 38 38  39 29 0a 2d 2d 2d 2d 2d  |g (&4C889).-----|
00002c20  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00002c30  2d 0a 52 30 20 3d 20 73  65 73 73 69 6f 6e 20 6c  |-.R0 = session l|
00002c40  6f 67 20 68 61 6e 64 6c  65 0a 0a 43 6c 6f 73 65  |og handle..Close|
00002c50  73 20 74 68 65 20 73 70  65 63 69 66 69 65 64 20  |s the specified |
00002c60  74 65 6d 70 6f 72 61 72  79 20 73 65 73 73 69 6f  |temporary sessio|
00002c70  6e 20 6c 6f 67 20 61 6e  64 20 61 70 70 65 6e 64  |n log and append|
00002c80  73 20 69 74 20 74 6f 20  74 68 65 20 61 70 70 72  |s it to the appr|
00002c90  6f 70 72 69 61 74 65 0a  6d 61 69 6e 20 6c 6f 67  |opriate.main log|
00002ca0  20 66 69 6c 65 2e 20 54  68 65 20 73 70 65 63 69  | file. The speci|
00002cb0  66 69 65 64 20 73 65 73  73 69 6f 6e 20 6c 6f 67  |fied session log|
00002cc0  20 68 61 6e 64 6c 65 20  69 73 20 6e 6f 20 6c 6f  | handle is no lo|
00002cd0  6e 67 65 72 20 76 61 6c  69 64 2e 0a 0a 0a 53 79  |nger valid....Sy|
00002ce0  73 4c 6f 67 5f 4c 6f 67  44 61 74 61 20 28 26 34  |sLog_LogData (&4|
00002cf0  43 38 38 41 29 0a 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |C88A).----------|
00002d00  2d 2d 2d 2d 0a 52 30 2d  3e 20 6c 6f 67 20 6e 61  |----.R0-> log na|
00002d10  6d 65 2c 20 6f 72 20 3d  20 73 65 73 73 69 6f 6e  |me, or = session|
00002d20  20 6c 6f 67 20 68 61 6e  64 6c 65 0a 52 31 20 3d  | log handle.R1 =|
00002d30  20 70 72 69 6f 72 69 74  79 0a 52 32 2d 3e 20 64  | priority.R2-> d|
00002d40  61 74 61 20 74 6f 20 6c  6f 67 0a 52 33 20 3d 20  |ata to log.R3 = |
00002d50  6e 75 6d 62 65 72 20 6f  66 20 62 79 74 65 73 20  |number of bytes |
00002d60  74 6f 20 6c 6f 67 0a 52  34 20 3d 20 76 61 6c 75  |to log.R4 = valu|
00002d70  65 20 74 6f 20 72 65 70  6f 72 74 20 61 73 20 62  |e to report as b|
00002d80  6c 6f 63 6b 20 6f 66 66  73 65 74 20 28 2d 31 20  |lock offset (-1 |
00002d90  6e 6f 74 20 74 6f 20 73  68 6f 77 20 62 6c 6f 63  |not to show bloc|
00002da0  6b 20 6f 66 66 73 65 74  29 0a 0a 4c 6f 67 73 20  |k offset)..Logs |
00002db0  61 20 62 6c 6f 63 6b 20  6f 66 20 64 61 74 61 2c  |a block of data,|
00002dc0  20 69 6e 20 61 20 68 65  78 2d 61 6e 64 2d 41 53  | in a hex-and-AS|
00002dd0  43 49 49 20 66 6f 72 6d  61 74 20 73 69 6d 69 6c  |CII format simil|
00002de0  61 72 20 74 6f 20 74 68  61 74 20 70 72 6f 64 75  |ar to that produ|
00002df0  63 65 64 20 62 79 0a 2a  44 75 6d 70 2e 20 54 68  |ced by.*Dump. Th|
00002e00  65 20 62 6c 6f 63 6b 20  6f 66 66 73 65 74 20 69  |e block offset i|
00002e10  73 20 74 68 65 20 76 61  6c 75 65 20 74 68 61 74  |s the value that|
00002e20  20 69 73 20 70 72 69 6e  74 65 64 20 61 74 20 74  | is printed at t|
00002e30  68 65 20 62 65 67 69 6e  6e 69 6e 67 20 6f 66 0a  |he beginning of.|
00002e40  65 61 63 68 20 6c 69 6e  65 2c 20 77 68 69 63 68  |each line, which|
00002e50  20 69 73 20 65 71 75 61  6c 20 74 6f 20 74 68 65  | is equal to the|
00002e60  20 76 61 6c 75 65 20 67  69 76 65 6e 20 6f 6e 20  | value given on |
00002e70  65 6e 74 72 79 20 70 6c  75 73 20 74 68 65 20 6e  |entry plus the n|
00002e80  75 6d 62 65 72 20 6f 66  0a 62 79 74 65 73 20 61  |umber of.bytes a|
00002e90  6c 72 65 61 64 79 20 64  69 73 70 6c 61 79 65 64  |lready displayed|
00002ea0  2e 20 49 66 20 2d 31 20  69 73 20 75 73 65 64 20  |. If -1 is used |
00002eb0  61 73 20 74 68 65 20 62  6c 6f 63 6b 20 6f 66 66  |as the block off|
00002ec0  73 65 74 20 74 68 65 6e  20 74 68 65 20 66 69 65  |set then the fie|
00002ed0  6c 64 0a 77 69 6c 6c 20  62 65 20 6f 6d 69 74 74  |ld.will be omitt|
00002ee0  65 64 2e 20 4e 6f 74 65  20 74 68 61 74 20 69 66  |ed. Note that if|
00002ef0  20 74 68 65 20 6e 75 6d  62 65 72 20 6f 66 20 62  | the number of b|
00002f00  79 74 65 73 20 74 6f 20  6c 6f 67 20 69 73 20 6f  |ytes to log is o|
00002f10  76 65 72 20 31 30 4b 42  20 74 68 65 6e 0a 74 68  |ver 10KB then.th|
00002f20  65 20 53 57 49 20 77 69  6c 6c 20 72 65 74 75 72  |e SWI will retur|
00002f30  6e 20 77 69 74 68 20 61  6e 20 65 72 72 6f 72 20  |n with an error |
00002f40  2d 20 6c 6f 67 67 69 6e  67 20 73 75 63 68 20 61  |- logging such a|
00002f50  20 6c 61 72 67 65 20 61  6d 6f 75 6e 74 20 6f 66  | large amount of|
00002f60  20 64 61 74 61 20 69 6e  0a 6f 6e 65 20 67 6f 20  | data in.one go |
00002f70  69 73 20 61 6c 6d 6f 73  74 20 63 65 72 74 61 69  |is almost certai|
00002f80  6e 6c 79 20 61 20 62 75  67 2c 20 73 6f 20 53 79  |nly a bug, so Sy|
00002f90  73 4c 6f 67 20 66 61 75  6c 74 73 20 69 74 20 74  |sLog faults it t|
00002fa0  6f 20 70 72 65 76 65 6e  74 20 74 68 65 0a 63 6f  |o prevent the.co|
00002fb0  6d 70 75 74 65 72 20 67  6f 69 6e 67 20 69 6e 74  |mputer going int|
00002fc0  6f 20 61 20 73 65 6d 69  2d 69 6e 66 69 6e 69 74  |o a semi-infinit|
00002fd0  65 20 6c 6f 6f 70 20 77  68 69 6c 65 20 69 74 20  |e loop while it |
00002fe0  77 72 69 74 65 73 20 68  75 67 65 20 61 6d 6f 75  |writes huge amou|
00002ff0  6e 74 73 20 6f 66 0a 64  61 74 61 20 74 6f 20 64  |nts of.data to d|
00003000  69 73 6b 2e 0a 0a 0a 53  79 73 4c 6f 67 5f 4c 6f  |isk....SysLog_Lo|
00003010  67 46 6f 72 6d 61 74 74  65 64 20 28 26 34 43 38  |gFormatted (&4C8|
00003020  38 42 29 0a 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |8B).------------|
00003030  2d 2d 2d 2d 2d 2d 2d 0a  52 30 2d 3e 20 6c 6f 67  |-------.R0-> log|
00003040  20 6e 61 6d 65 2c 20 6f  72 20 3d 20 73 65 73 73  | name, or = sess|
00003050  69 6f 6e 20 6c 6f 67 20  68 61 6e 64 6c 65 0a 52  |ion log handle.R|
00003060  31 2d 3e 20 66 6f 72 6d  61 74 20 73 74 72 69 6e  |1-> format strin|
00003070  67 0a 52 32 20 3d 20 70  72 69 6f 72 69 74 79 0a  |g.R2 = priority.|
00003080  52 33 2d 3e 20 62 6c 6f  63 6b 20 63 6f 6e 74 61  |R3-> block conta|
00003090  69 6e 69 6e 67 20 52 30  2d 52 33 2c 52 38 2d 52  |ining R0-R3,R8-R|
000030a0  31 32 2c 52 31 34 0a 52  34 2d 52 37 20 3d 20 70  |12,R14.R4-R7 = p|
000030b0  61 72 61 6d 65 74 65 72  73 0a 0a 45 76 61 6c 75  |arameters..Evalu|
000030c0  61 74 65 73 20 61 20 66  6f 72 6d 61 74 74 65 64  |ates a formatted|
000030d0  20 73 74 72 69 6e 67 20  75 73 69 6e 67 20 72 65  | string using re|
000030e0  67 69 73 74 65 72 73 20  52 34 2d 52 37 2c 20 61  |gisters R4-R7, a|
000030f0  6e 64 20 52 30 2d 52 33  2c 20 52 38 2d 52 31 32  |nd R0-R3, R8-R12|
00003100  20 61 6e 64 0a 52 31 34  20 66 72 6f 6d 20 74 68  | and.R14 from th|
00003110  65 20 62 6c 6f 63 6b 20  70 61 73 73 65 64 20 69  |e block passed i|
00003120  6e 20 52 33 2c 20 61 6e  64 20 6c 6f 67 73 20 74  |n R3, and logs t|
00003130  68 65 20 72 65 73 75 6c  74 2e 20 53 65 65 20 74  |he result. See t|
00003140  68 65 20 73 65 63 74 69  6f 6e 0a 22 4c 6f 67 46  |he section."LogF|
00003150  6f 72 6d 61 74 74 65 64  22 2c 20 62 65 6c 6f 77  |ormatted", below|
00003160  2e 0a 0a 0a 53 79 73 4c  6f 67 5f 52 65 61 64 45  |....SysLog_ReadE|
00003170  72 72 6f 72 4d 65 73 73  61 67 65 20 28 26 34 43  |rrorMessage (&4C|
00003180  38 38 43 29 0a 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |88C).-----------|
00003190  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 0a 52 30 20  |------------.R0 |
000031a0  3d 20 65 72 72 6f 72 20  6e 75 6d 62 65 72 0a 65  |= error number.e|
000031b0  78 69 74 3a 0a 52 30 2d  3e 20 65 72 72 6f 72 20  |xit:.R0-> error |
000031c0  6d 65 73 73 61 67 65 0a  0a 43 6f 6e 76 65 72 74  |message..Convert|
000031d0  73 20 61 6e 20 65 72 72  6f 72 20 6e 75 6d 62 65  |s an error numbe|
000031e0  72 20 61 73 20 72 65 74  75 72 6e 65 64 20 62 79  |r as returned by|
000031f0  20 74 68 65 20 46 72 65  65 4e 65 74 2f 49 6e 74  | the FreeNet/Int|
00003200  65 72 6e 65 74 2f 65 74  63 20 6d 6f 64 75 6c 65  |ernet/etc module|
00003210  73 0a 69 6e 74 6f 20 61  20 73 74 72 69 6e 67 20  |s.into a string |
00003220  64 65 73 63 72 69 62 69  6e 67 20 74 68 65 20 65  |describing the e|
00003230  72 72 6f 72 2e 20 65 2e  67 2e 20 53 79 73 4c 6f  |rror. e.g. SysLo|
00003240  67 5f 52 65 61 64 45 72  72 6f 72 4d 65 73 73 61  |g_ReadErrorMessa|
00003250  67 65 20 36 30 20 77 6f  75 6c 64 0a 72 65 74 75  |ge 60 would.retu|
00003260  72 6e 20 22 43 6f 6e 6e  65 63 74 69 6f 6e 20 74  |rn "Connection t|
00003270  69 6d 65 64 20 6f 75 74  22 2e 0a 0a 0a 53 79 73  |imed out"....Sys|
00003280  4c 6f 67 5f 4c 6f 67 43  6f 6d 70 6c 65 74 65 20  |Log_LogComplete |
00003290  28 26 34 43 38 38 44 29  0a 2d 2d 2d 2d 2d 2d 2d  |(&4C88D).-------|
000032a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0a 52 30 2d 3e  |-----------.R0->|
000032b0  20 6c 6f 67 20 6e 61 6d  65 0a 0a 46 6c 75 73 68  | log name..Flush|
000032c0  65 73 20 74 68 65 20 73  70 65 63 69 66 69 65 64  |es the specified|
000032d0  20 6c 6f 67 2c 20 61 6e  64 20 64 65 2d 61 6c 6c  | log, and de-all|
000032e0  6f 63 61 74 65 73 20 74  68 65 20 62 75 66 66 65  |ocates the buffe|
000032f0  72 20 61 73 73 6f 63 69  61 74 65 64 20 77 69 74  |r associated wit|
00003300  68 20 69 74 2e 0a 54 68  69 73 20 73 68 6f 75 6c  |h it..This shoul|
00003310  64 20 6f 6e 6c 79 20 62  65 20 63 61 6c 6c 65 64  |d only be called|
00003320  20 69 66 20 74 68 65 20  6c 6f 67 20 69 73 20 64  | if the log is d|
00003330  65 66 69 6e 69 74 65 6c  79 20 6e 6f 74 20 67 6f  |efinitely not go|
00003340  69 6e 67 20 74 6f 20 62  65 20 75 73 65 64 20 66  |ing to be used f|
00003350  6f 72 0a 61 20 77 68 69  6c 65 20 28 65 2e 67 2e  |or.a while (e.g.|
00003360  20 69 66 20 79 6f 75 72  20 61 70 70 6c 69 63 61  | if your applica|
00003370  74 69 6f 6e 20 69 73 20  74 68 65 20 6f 6e 6c 79  |tion is the only|
00003380  20 6f 6e 65 20 77 68 69  63 68 20 63 61 6e 20 62  | one which can b|
00003390  65 20 77 72 69 74 69 6e  67 20 74 6f 0a 74 68 65  |e writing to.the|
000033a0  20 6c 6f 67 2c 20 61 6e  64 20 69 74 27 73 20 65  | log, and it's e|
000033b0  78 69 74 69 6e 67 29 2e  20 49 66 20 74 68 69 73  |xiting). If this|
000033c0  20 69 73 6e 27 74 20 63  61 6c 6c 65 64 20 65 78  | isn't called ex|
000033d0  70 6c 69 63 69 74 79 2c  20 53 79 73 4c 6f 67 0a  |plicity, SysLog.|
000033e0  61 75 74 6f 6d 61 74 69  63 61 6c 6c 79 20 64 65  |automatically de|
000033f0  2d 61 6c 6c 6f 63 61 74  65 73 20 74 68 65 20 6c  |-allocates the l|
00003400  6f 67 20 62 75 66 66 65  72 20 61 66 74 65 72 20  |og buffer after |
00003410  74 65 6e 20 6d 69 6e 75  74 65 73 20 6f 66 20 69  |ten minutes of i|
00003420  6e 61 63 74 69 76 69 74  79 20 69 6e 0a 74 68 65  |nactivity in.the|
00003430  20 6c 6f 67 2e 0a 0a 0a  3d 3d 3d 3d 3d 3d 3d 3d  | log....========|
00003440  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00003480  3d 3d 3d 3d 0a 4c 6f 67  46 6f 72 6d 61 74 74 65  |====.LogFormatte|
00003490  64 0a 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |d.--------------|
000034a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000034d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0a 0a  |--------------..|
000034e0  53 57 49 20 53 79 73 4c  6f 67 5f 4c 6f 67 46 6f  |SWI SysLog_LogFo|
000034f0  72 6d 61 74 74 65 64 20  70 72 6f 76 69 64 65 73  |rmatted provides|
00003500  20 43 20 22 70 72 69 6e  74 66 22 2d 73 74 79 6c  | C "printf"-styl|
00003510  65 20 66 75 6e 63 74 69  6f 6e 61 6c 69 74 79 20  |e functionality |
00003520  66 6f 72 0a 61 73 73 65  6d 62 6c 65 72 20 70 72  |for.assembler pr|
00003530  6f 67 72 61 6d 6d 65 72  73 2e 20 41 20 66 6f 72  |ogrammers. A for|
00003540  6d 61 74 20 73 74 72 69  6e 67 20 69 73 20 70 61  |mat string is pa|
00003550  73 73 65 64 20 69 6e 20  52 31 2c 20 77 68 69 63  |ssed in R1, whic|
00003560  68 20 69 73 20 61 20 74  65 6d 70 6c 61 74 65 0a  |h is a template.|
00003570  66 6f 72 20 74 68 65 20  6f 75 74 70 75 74 2e 20  |for the output. |
00003580  54 68 65 20 73 74 72 69  6e 67 20 69 73 20 63 6f  |The string is co|
00003590  70 69 65 64 20 64 69 72  65 63 74 6c 79 20 74 6f  |pied directly to|
000035a0  20 74 68 65 20 6f 75 74  70 75 74 2c 20 65 78 63  | the output, exc|
000035b0  65 70 74 20 66 6f 72 20  27 25 27 0a 63 68 61 72  |ept for '%'.char|
000035c0  61 63 74 65 72 73 2c 20  77 68 69 63 68 20 69 6e  |acters, which in|
000035d0  73 65 72 74 73 20 61 20  73 74 72 69 6e 67 20 63  |serts a string c|
000035e0  61 6c 63 75 6c 61 74 65  64 20 77 68 65 6e 20 74  |alculated when t|
000035f0  68 65 20 53 57 49 20 69  73 20 63 61 6c 6c 65 64  |he SWI is called|
00003600  3a 0a 0a 20 20 20 20 20  20 20 20 25 25 20 20 20  |:..        %%   |
00003610  20 20 20 2d 20 74 68 65  20 6c 69 74 65 72 61 6c  |   - the literal|
00003620  20 27 25 27 20 63 68 61  72 61 63 74 65 72 0a 20  | '%' character. |
00003630  20 20 20 20 20 20 20 25  3c 72 65 67 3e 61 20 2d  |       %<reg>a -|
00003640  20 74 68 65 20 6e 65 74  77 6f 72 6b 2d 62 79 74  | the network-byt|
00003650  65 2d 6f 72 64 65 72 65  64 20 49 50 20 61 64 64  |e-ordered IP add|
00003660  72 65 73 73 20 69 6e 20  72 65 67 69 73 74 65 72  |ress in register|
00003670  20 3c 72 65 67 3e 0a 20  20 20 20 20 20 20 20 25  | <reg>.        %|
00003680  3c 72 65 67 3e 63 20 2d  20 74 68 65 20 63 68 61  |<reg>c - the cha|
00003690  72 61 63 74 65 72 20 69  6e 20 72 65 67 69 73 74  |racter in regist|
000036a0  65 72 20 3c 72 65 67 3e  0a 20 20 20 20 20 20 20  |er <reg>.       |
000036b0  20 25 3c 72 65 67 3e 64  20 2d 20 74 68 65 20 73  | %<reg>d - the s|
000036c0  69 67 6e 65 64 20 64 65  63 69 6d 61 6c 20 69 6e  |igned decimal in|
000036d0  74 65 67 65 72 20 69 6e  20 72 65 67 69 73 74 65  |teger in registe|
000036e0  72 20 3c 72 65 67 3e 0a  20 20 20 20 20 20 20 20  |r <reg>.        |
000036f0  25 3c 72 65 67 3e 65 20  2d 20 74 68 65 20 6d 65  |%<reg>e - the me|
00003700  73 73 61 67 65 20 66 6f  72 20 74 68 65 20 46 72  |ssage for the Fr|
00003710  65 65 4e 65 74 20 65 72  72 6f 72 20 6e 75 6d 62  |eeNet error numb|
00003720  65 72 20 69 6e 20 72 65  67 69 73 74 65 72 20 3c  |er in register <|
00003730  72 65 67 3e 0a 20 20 20  20 20 20 20 20 25 3c 72  |reg>.        %<r|
00003740  65 67 3e 66 20 2d 20 74  68 65 20 66 69 6c 65 6e  |eg>f - the filen|
00003750  61 6d 65 20 6f 66 20 74  68 65 20 66 69 6c 65 20  |ame of the file |
00003760  68 61 6e 64 6c 65 20 69  6e 20 72 65 67 69 73 74  |handle in regist|
00003770  65 72 20 3c 72 65 67 3e  0a 20 20 20 20 20 20 20  |er <reg>.       |
00003780  20 25 3c 72 65 67 3e 70  20 2d 20 74 68 65 20 6f  | %<reg>p - the o|
00003790  62 6a 65 63 74 20 70 6f  69 6e 74 65 64 20 74 6f  |bject pointed to|
000037a0  20 62 79 20 72 65 67 69  73 74 65 72 20 3c 72 65  | by register <re|
000037b0  67 3e 0a 20 20 20 20 20  20 20 20 25 3c 72 65 67  |g>.        %<reg|
000037c0  3e 73 20 2d 20 74 68 65  20 63 6f 6e 74 72 6f 6c  |>s - the control|
000037d0  2d 74 65 72 6d 69 6e 61  74 65 64 20 73 74 72 69  |-terminated stri|
000037e0  6e 67 20 70 6f 69 6e 74  65 64 20 74 6f 20 62 79  |ng pointed to by|
000037f0  20 72 65 67 69 73 74 65  72 20 3c 72 65 67 3e 0a  | register <reg>.|
00003800  20 20 20 20 20 20 20 20  25 3c 72 65 67 3e 78 20  |        %<reg>x |
00003810  2d 20 74 68 65 20 75 6e  73 69 67 6e 65 64 20 68  |- the unsigned h|
00003820  65 78 61 64 65 63 69 6d  61 6c 20 69 6e 74 65 67  |exadecimal integ|
00003830  65 72 20 69 6e 20 72 65  67 69 73 74 65 72 20 3c  |er in register <|
00003840  72 65 67 3e 0a 20 20 20  20 20 20 20 20 25 3c 72  |reg>.        %<r|
00003850  65 67 3e 7a 20 2d 20 74  68 65 20 7a 65 72 6f 2d  |eg>z - the zero-|
00003860  74 65 72 6d 69 6e 61 74  65 64 20 73 74 72 69 6e  |terminated strin|
00003870  67 20 70 6f 69 6e 74 65  64 20 74 6f 20 62 79 20  |g pointed to by |
00003880  72 65 67 69 73 74 65 72  20 3c 72 65 67 3e 0a 0a  |register <reg>..|
00003890  20 20 20 77 68 65 72 65  20 3c 72 65 67 3e 20 69  |   where <reg> i|
000038a0  73 20 61 20 6e 75 6d 62  65 72 20 77 68 69 63 68  |s a number which|
000038b0  20 63 61 6e 20 62 65 20  61 6e 79 20 6f 66 20 30  | can be any of 0|
000038c0  20 74 6f 20 31 32 20 6f  72 20 31 34 2e 0a 0a 4e  | to 12 or 14...N|
000038d0  6f 74 65 20 74 68 61 74  20 74 68 65 20 25 3c 72  |ote that the %<r|
000038e0  65 67 3e 70 20 74 79 70  65 20 6d 75 73 74 20 62  |eg>p type must b|
000038f0  65 20 66 6f 6c 6c 6f 77  65 64 20 62 79 20 61 6e  |e followed by an|
00003900  6f 74 68 65 72 20 74 79  70 65 20 69 6e 64 69 63  |other type indic|
00003910  61 74 6f 72 2e 20 46 6f  72 0a 65 78 61 6d 70 6c  |ator. For.exampl|
00003920  65 2c 20 74 6f 20 6c 6f  67 20 61 20 63 68 61 72  |e, to log a char|
00003930  61 63 74 65 72 20 70 6f  69 6e 74 65 64 20 74 6f  |acter pointed to|
00003940  20 62 79 20 72 65 67 69  73 74 65 72 20 52 33 2c  | by register R3,|
00003950  20 75 73 65 20 22 25 33  70 63 22 2e 20 4d 6f 72  | use "%3pc". Mor|
00003960  65 20 74 68 61 6e 0a 6f  6e 65 20 27 70 27 20 63  |e than.one 'p' c|
00003970  61 6e 20 62 65 20 75 73  65 64 20 74 6f 20 69 6e  |an be used to in|
00003980  64 69 63 61 74 65 20 6d  6f 72 65 20 74 68 61 6e  |dicate more than|
00003990  20 6f 6e 65 20 6c 65 76  65 6c 20 6f 66 20 69 6e  | one level of in|
000039a0  64 69 72 65 63 74 69 6f  6e 2e 0a 0a 4e 75 6c 6c  |direction...Null|
000039b0  20 70 6f 69 6e 74 65 72  73 20 61 72 65 20 65 78  | pointers are ex|
000039c0  70 6c 69 63 69 74 6c 79  20 63 68 65 63 6b 65 64  |plicitly checked|
000039d0  20 66 6f 72 20 77 68 65  72 65 76 65 72 20 75 73  | for wherever us|
000039e0  65 64 2c 20 61 6e 64 20  74 68 65 20 73 74 72 69  |ed, and the stri|
000039f0  6e 67 0a 22 28 6e 75 6c  6c 29 22 20 69 73 20 6c  |ng."(null)" is l|
00003a00  6f 67 67 65 64 20 69 6e  20 70 6c 61 63 65 20 6f  |ogged in place o|
00003a10  66 20 77 68 61 74 65 76  65 72 20 73 68 6f 75 6c  |f whatever shoul|
00003a20  64 20 68 61 76 65 20 62  65 65 6e 20 6f 75 74 70  |d have been outp|
00003a30  75 74 2e 20 48 65 6e 63  65 20 69 74 0a 69 73 20  |ut. Hence it.is |
00003a40  65 78 70 6c 69 63 69 74  79 20 64 65 66 69 6e 65  |explicity define|
00003a50  64 20 74 68 61 74 20 69  74 20 69 73 20 73 61 66  |d that it is saf|
00003a60  65 20 74 6f 20 61 6c 6c  6f 77 20 6e 75 6c 6c 20  |e to allow null |
00003a70  70 6f 69 6e 74 65 72 73  20 74 6f 20 62 65 20 69  |pointers to be i|
00003a80  6e 0a 72 65 67 69 73 74  65 72 73 20 75 73 65 64  |n.registers used|
00003a90  20 62 79 20 74 68 65 20  66 6f 72 6d 61 74 20 73  | by the format s|
00003aa0  74 72 69 6e 67 2e 0a 0a  52 65 67 69 73 74 65 72  |tring...Register|
00003ab0  73 20 52 34 2d 52 37 20  61 72 65 20 74 61 6b 65  |s R4-R7 are take|
00003ac0  6e 20 64 69 72 65 63 74  6c 79 20 66 72 6f 6d 20  |n directly from |
00003ad0  74 68 65 20 72 65 67 69  73 74 65 72 73 20 70 61  |the registers pa|
00003ae0  73 73 65 64 20 74 6f 20  74 68 65 20 53 57 49 2e  |ssed to the SWI.|
00003af0  0a 52 65 67 69 73 74 65  72 73 20 52 30 2d 52 33  |.Registers R0-R3|
00003b00  2c 20 52 38 2d 52 31 32  20 61 6e 64 20 52 31 34  |, R8-R12 and R14|
00003b10  20 61 72 65 20 74 61 6b  65 6e 20 66 72 6f 6d 20  | are taken from |
00003b20  74 68 65 20 62 6c 6f 63  6b 20 70 61 73 73 65 64  |the block passed|
00003b30  20 69 6e 20 52 33 2e 0a  0a 49 74 20 69 73 20 65  | in R3...It is e|
00003b40  78 70 65 63 74 65 64 20  74 68 61 74 20 74 68 69  |xpected that thi|
00003b50  73 20 53 57 49 20 77 6f  75 6c 64 20 62 65 20 70  |s SWI would be p|
00003b60  61 63 6b 61 67 65 64 20  69 6e 20 61 20 6d 61 63  |ackaged in a mac|
00003b70  72 6f 20 69 6e 20 79 6f  75 72 20 61 73 73 65 6d  |ro in your assem|
00003b80  62 6c 65 72 0a 73 6f 75  72 63 65 20 63 6f 64 65  |bler.source code|
00003b90  2e 20 46 6f 72 20 65 78  61 6d 70 6c 65 3a 0a 0a  |. For example:..|
00003ba0  2e 2e 2e 0a 2e 73 74 72  69 63 6d 70 0a 20 20 46  |.....stricmp.  F|
00003bb0  4e 6c 6f 67 66 28 22 73  74 72 69 63 6d 70 3a 20  |Nlogf("stricmp: |
00003bc0  63 6f 6d 70 61 72 69 6e  67 20 25 30 7a 20 61 6e  |comparing %0z an|
00003bd0  64 20 25 31 7a 22 2c 32  30 30 29 0a 2e 2e 2e 0a  |d %1z",200).....|
00003be0  0a 44 45 46 20 46 4e 6c  6f 67 66 28 74 24 2c 70  |.DEF FNlogf(t$,p|
00003bf0  25 29 0a 20 20 5b 4f 50  54 20 70 0a 20 20 20 20  |%).  [OPT p.    |
00003c00  53 54 4d 46 44 20 20 20  52 31 33 21 2c 7b 52 30  |STMFD   R13!,{R0|
00003c10  2d 52 33 2c 52 38 2d 52  31 32 2c 52 31 34 7d 0a  |-R3,R8-R12,R14}.|
00003c20  20 20 20 20 41 44 52 20  20 20 20 20 52 30 2c 74  |    ADR     R0,t|
00003c30  78 74 5f 6c 6f 67 6e 61  6d 65 0a 20 20 20 20 41  |xt_logname.    A|
00003c40  44 44 20 20 20 20 20 52  31 2c 52 31 35 2c 23 31  |DD     R1,R15,#1|
00003c50  32 0a 20 20 20 20 4d 4f  56 20 20 20 20 20 52 32  |2.    MOV     R2|
00003c60  2c 23 70 25 0a 20 20 20  20 4d 4f 56 20 20 20 20  |,#p%.    MOV    |
00003c70  20 52 33 2c 52 31 33 0a  20 20 20 20 53 57 49 20  | R3,R13.    SWI |
00003c80  20 20 20 20 22 53 79 73  4c 6f 67 5f 4c 6f 67 46  |    "SysLog_LogF|
00003c90  6f 72 6d 61 74 74 65 64  22 0a 20 20 20 20 42 20  |ormatted".    B |
00003ca0  20 20 20 20 20 20 50 25  2b 28 4c 45 4e 74 24 2b  |      P%+(LENt$+|
00003cb0  38 29 41 4e 44 4e 4f 54  33 0a 20 20 20 20 45 51  |8)ANDNOT3.    EQ|
00003cc0  55 53 20 20 20 20 74 24  2b 53 54 52 49 4e 47 24  |US    t$+STRING$|
00003cd0  28 34 2d 28 4c 45 4e 74  24 41 4e 44 33 29 2c 43  |(4-(LENt$AND3),C|
00003ce0  48 52 24 30 29 0a 20 20  20 20 4c 44 4d 46 44 20  |HR$0).    LDMFD |
00003cf0  20 20 52 31 33 21 2c 7b  52 30 2d 52 33 2c 52 38  |  R13!,{R0-R3,R8|
00003d00  2d 52 31 32 2c 52 31 34  7d 0a 20 20 5d 0a 3d 70  |-R12,R14}.  ].=p|
00003d10  0a 0a 6f 72 20 74 68 65  20 4f 62 6a 41 73 6d 20  |..or the ObjAsm |
00003d20  65 71 75 69 76 61 6c 65  6e 74 3a 0a 0a 20 20 20  |equivalent:..   |
00003d30  20 20 20 20 20 4d 41 43  52 4f 0a 20 20 20 20 20  |     MACRO.     |
00003d40  20 20 20 4c 4f 47 46 20  20 20 20 24 74 2c 24 70  |   LOGF    $t,$p|
00003d50  0a 0a 20 20 20 20 20 20  20 20 53 54 4d 46 44 20  |..        STMFD |
00003d60  20 20 52 31 33 21 2c 7b  52 30 2d 52 33 2c 52 38  |  R13!,{R0-R3,R8|
00003d70  2d 52 31 32 2c 52 31 34  7d 0a 20 20 20 20 20 20  |-R12,R14}.      |
00003d80  20 20 41 44 52 20 20 20  20 20 52 30 2c 74 78 74  |  ADR     R0,txt|
00003d90  5f 6c 6f 67 6e 61 6d 65  0a 20 20 20 20 20 20 20  |_logname.       |
00003da0  20 41 44 52 20 20 20 20  20 52 31 2c 25 66 74 39  | ADR     R1,%ft9|
00003db0  30 0a 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |0.        MOV   |
00003dc0  20 20 52 32 2c 23 24 70  0a 20 20 20 20 20 20 20  |  R2,#$p.       |
00003dd0  20 4d 4f 56 20 20 20 20  20 52 33 2c 52 31 33 0a  | MOV     R3,R13.|
00003de0  20 20 20 20 20 20 20 20  53 57 49 20 20 20 20 20  |        SWI     |
00003df0  53 79 73 4c 6f 67 5f 4c  6f 67 46 6f 72 6d 61 74  |SysLog_LogFormat|
00003e00  74 65 64 0a 20 20 20 20  20 20 20 20 42 20 20 20  |ted.        B   |
00003e10  20 20 20 20 25 66 74 39  31 0a 39 30 0a 20 20 20  |    %ft91.90.   |
00003e20  20 20 20 20 20 3d 20 20  20 20 20 20 20 22 24 74  |     =       "$t|
00003e30  22 2c 30 0a 20 20 20 20  20 20 20 20 41 4c 49 47  |",0.        ALIG|
00003e40  4e 0a 39 31 20 20 20 20  20 20 4c 44 4d 46 44 20  |N.91      LDMFD |
00003e50  20 20 52 31 33 21 2c 7b  52 30 2d 52 33 2c 52 38  |  R13!,{R0-R3,R8|
00003e60  2d 52 31 32 2c 52 31 34  7d 0a 20 20 20 20 20 20  |-R12,R14}.      |
00003e70  20 20 4d 45 4e 44 0a 0a  2e 2e 2e 0a 73 74 72 69  |  MEND......stri|
00003e80  63 6d 70 20 52 4f 55 54  0a 20 20 20 20 20 20 20  |cmp ROUT.       |
00003e90  20 4c 4f 47 46 20 20 20  20 22 73 74 72 69 63 6d  | LOGF    "stricm|
00003ea0  70 3a 20 63 6f 6d 70 61  72 69 6e 67 20 25 30 7a  |p: comparing %0z|
00003eb0  20 61 6e 64 20 25 31 7a  22 2c 32 30 30 0a 2e 2e  | and %1z",200...|
00003ec0  2e 0a 0a 0a 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |....============|
00003ed0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00003f10  0a 55 73 69 6e 67 20 53  79 73 4c 6f 67 20 66 72  |.Using SysLog fr|
00003f20  6f 6d 20 43 20 70 72 6f  67 72 61 6d 73 0a 2d 2d  |om C programs.--|
00003f30  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00003f70  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0a 0a 54 6f 20 6d  |----------..To m|
00003f80  61 6b 65 20 53 79 73 4c  6f 67 20 65 61 73 79 20  |ake SysLog easy |
00003f90  74 6f 20 75 73 65 20 66  72 6f 6d 20 43 20 70 72  |to use from C pr|
00003fa0  6f 67 72 61 6d 73 2c 20  49 20 68 61 76 65 20 77  |ograms, I have w|
00003fb0  72 69 74 74 65 6e 20 61  6e 20 41 50 43 53 20 76  |ritten an APCS v|
00003fc0  65 6e 65 65 72 0a 66 6f  72 20 74 68 65 20 6d 6f  |eneer.for the mo|
00003fd0  64 75 6c 65 2e 20 54 68  69 73 20 74 61 6b 65 73  |dule. This takes|
00003fe0  20 74 68 65 20 66 6f 72  6d 20 6f 66 20 61 20 22  | the form of a "|
00003ff0  73 79 73 6c 6f 67 2e 68  22 20 68 65 61 64 65 72  |syslog.h" header|
00004000  20 66 69 6c 65 20 77 68  69 63 68 20 79 6f 75 0a  | file which you.|
00004010  73 68 6f 75 6c 64 20 23  69 6e 63 6c 75 64 65 20  |should #include |
00004020  66 72 6f 6d 20 79 6f 75  72 20 43 20 73 6f 75 72  |from your C sour|
00004030  63 65 2c 20 61 6e 64 20  61 20 22 73 79 73 6c 6f  |ce, and a "syslo|
00004040  67 2e 6f 22 20 6f 62 6a  65 63 74 20 66 69 6c 65  |g.o" object file|
00004050  20 77 68 69 63 68 20 79  6f 75 0a 73 68 6f 75 6c  | which you.shoul|
00004060  64 20 6c 69 6e 6b 20 79  6f 75 72 20 70 72 6f 67  |d link your prog|
00004070  72 61 6d 20 77 69 74 68  2e 0a 0a 54 68 65 72 65  |ram with...There|
00004080  20 61 72 65 20 74 77 6f  20 63 61 6c 6c 73 20 66  | are two calls f|
00004090  6f 72 20 65 61 63 68 20  53 57 49 2c 20 6f 6e 65  |or each SWI, one|
000040a0  20 77 68 69 63 68 20 75  73 65 73 20 74 68 65 20  | which uses the |
000040b0  6e 6f 6e 2d 58 20 66 6f  72 6d 20 61 6e 64 20 6f  |non-X form and o|
000040c0  6e 65 0a 77 68 69 63 68  20 75 73 65 73 20 74 68  |ne.which uses th|
000040d0  65 20 58 20 66 6f 72 6d  20 61 6e 64 20 72 65 74  |e X form and ret|
000040e0  75 72 6e 73 20 61 20 5f  6b 65 72 6e 65 6c 5f 6f  |urns a _kernel_o|
000040f0  73 65 72 72 6f 72 20 2a  2e 20 54 68 65 20 6e 6f  |serror *. The no|
00004100  6e 2d 58 20 66 6f 72 6d  73 20 61 72 65 0a 67 65  |n-X forms are.ge|
00004110  6e 65 72 61 6c 6c 79 20  6e 69 63 65 72 20 61 73  |nerally nicer as|
00004120  20 76 61 6c 75 65 73 20  63 61 6e 20 62 65 20 72  | values can be r|
00004130  65 74 75 72 6e 65 64 20  69 6e 20 74 68 65 20 75  |eturned in the u|
00004140  73 75 61 6c 20 6d 61 6e  6e 65 72 2c 20 72 61 74  |sual manner, rat|
00004150  68 65 72 20 74 68 61 6e  0a 68 61 76 69 6e 67 20  |her than.having |
00004160  74 6f 20 70 61 73 73 20  61 20 70 6f 69 6e 74 65  |to pass a pointe|
00004170  72 20 74 6f 20 61 20 6c  6f 63 61 74 69 6f 6e 20  |r to a location |
00004180  74 6f 20 62 65 20 66 69  6c 6c 65 64 20 69 6e 20  |to be filled in |
00004190  77 69 74 68 20 74 68 65  20 72 65 74 75 72 6e 20  |with the return |
000041a0  63 6f 64 65 2e 0a 49 20  77 6f 75 6c 64 20 73 75  |code..I would su|
000041b0  67 67 65 73 74 20 6f 6e  6c 79 20 75 73 69 6e 67  |ggest only using|
000041c0  20 74 68 65 20 58 20 66  6f 72 6d 73 20 77 68 65  | the X forms whe|
000041d0  6e 20 79 6f 75 20 61 62  73 6f 6c 75 74 65 6c 79  |n you absolutely|
000041e0  20 6d 75 73 74 20 2d 20  69 2e 65 2e 20 69 6e 0a  | must - i.e. in.|
000041f0  6d 6f 64 75 6c 65 20 63  6f 64 65 2c 20 65 74 63  |module code, etc|
00004200  2e 0a 0a 54 68 65 72 65  27 73 20 61 6c 73 6f 20  |...There's also |
00004210  61 20 62 6f 6e 75 73 20  66 75 6e 63 74 69 6f 6e  |a bonus function|
00004220  20 22 73 79 73 6c 6f 67  66 22 20 28 61 6e 64 20  | "syslogf" (and |
00004230  22 78 73 79 73 6c 6f 67  66 22 29 20 77 68 69 63  |"xsyslogf") whic|
00004240  68 20 69 73 20 6c 69 6b  65 0a 22 70 72 69 6e 74  |h is like."print|
00004250  66 22 20 65 78 63 65 70  74 20 69 74 20 6f 75 74  |f" except it out|
00004260  70 75 74 73 20 74 6f 20  74 68 65 20 6c 6f 67 2e  |puts to the log.|
00004270  20 54 68 65 20 66 69 72  73 74 20 74 77 6f 20 61  | The first two a|
00004280  72 67 75 6d 65 6e 74 73  20 61 72 65 20 74 68 65  |rguments are the|
00004290  0a 6c 6f 67 6e 61 6d 65  20 61 6e 64 20 70 72 69  |.logname and pri|
000042a0  6f 72 69 74 79 2c 20 61  6e 64 20 74 68 65 20 72  |ority, and the r|
000042b0  65 73 74 20 61 72 65 20  74 68 65 20 75 73 75 61  |est are the usua|
000042c0  6c 20 70 72 69 6e 74 66  20 61 72 67 75 6d 65 6e  |l printf argumen|
000042d0  74 73 20 28 69 2e 65 2e  0a 74 68 65 20 66 6f 72  |ts (i.e..the for|
000042e0  6d 61 74 20 73 74 72 69  6e 67 20 66 6f 6c 6c 6f  |mat string follo|
000042f0  77 65 64 20 62 79 20 61  20 76 61 72 69 61 62 6c  |wed by a variabl|
00004300  65 20 6e 75 6d 62 65 72  20 6f 66 20 61 72 67 75  |e number of argu|
00004310  6d 65 6e 74 73 29 2e 0a  0a 4e 6f 74 65 20 74 68  |ments)...Note th|
00004320  61 74 20 61 20 74 65 6d  70 6f 72 61 72 79 20 62  |at a temporary b|
00004330  75 66 66 65 72 20 69 73  20 75 73 65 64 20 74 6f  |uffer is used to|
00004340  20 68 6f 6c 64 20 74 68  65 20 73 74 72 69 6e 67  | hold the string|
00004350  20 62 65 66 6f 72 65 20  69 74 20 69 73 20 70 61  | before it is pa|
00004360  73 73 65 64 0a 74 6f 20  74 68 65 20 53 79 73 4c  |ssed.to the SysL|
00004370  6f 67 20 6d 6f 64 75 6c  65 20 61 6e 64 20 2a 54  |og module and *T|
00004380  48 49 53 20 42 55 46 46  45 52 20 49 53 20 4f 4e  |HIS BUFFER IS ON|
00004390  4c 59 20 31 30 32 34 20  42 59 54 45 53 20 4c 4f  |LY 1024 BYTES LO|
000043a0  4e 47 2a 2e 20 69 2e 65  2e 20 79 6f 75 0a 6d 75  |NG*. i.e. you.mu|
000043b0  73 74 20 65 6e 73 75 72  65 20 74 68 61 74 20 79  |st ensure that y|
000043c0  6f 75 72 20 66 6f 72 6d  61 74 20 73 74 72 69 6e  |our format strin|
000043d0  67 20 63 61 6e 6e 6f 74  20 65 76 65 72 20 70 72  |g cannot ever pr|
000043e0  6f 64 75 63 65 20 6d 6f  72 65 20 74 68 61 6e 20  |oduce more than |
000043f0  31 30 32 34 20 62 79 74  65 73 0a 6f 66 20 6f 75  |1024 bytes.of ou|
00004400  74 70 75 74 2e 20 54 68  69 73 20 69 73 20 65 73  |tput. This is es|
00004410  70 65 63 69 61 6c 6c 79  20 69 6d 70 6f 72 74 61  |pecially importa|
00004420  6e 74 20 69 6e 20 6e 65  74 77 6f 72 6b 69 6e 67  |nt in networking|
00004430  20 73 6f 66 74 77 61 72  65 20 77 68 65 72 65 20  | software where |
00004440  74 68 65 0a 69 6e 70 75  74 20 6d 61 79 20 62 65  |the.input may be|
00004450  20 63 6f 6d 69 6e 67 20  66 72 6f 6d 20 61 20 42  | coming from a B|
00004460  61 64 20 4d 69 73 63 72  65 61 6e 74 20 77 68 6f  |ad Miscreant who|
00004470  20 69 73 20 74 72 79 69  6e 67 20 74 6f 20 68 61  | is trying to ha|
00004480  63 6b 20 69 6e 74 6f 20  6f 72 20 63 72 61 73 68  |ck into or crash|
00004490  0a 79 6f 75 72 20 6d 61  63 68 69 6e 65 2e 0a 0a  |.your machine...|
000044a0  54 68 65 20 4f 62 6a 41  73 6d 20 73 6f 75 72 63  |The ObjAsm sourc|
000044b0  65 20 74 6f 20 74 68 65  20 76 65 6e 65 65 72 20  |e to the veneer |
000044c0  6f 62 6a 65 63 74 20 66  69 6c 65 20 69 73 20 70  |object file is p|
000044d0  72 6f 76 69 64 65 64 2e  20 49 66 20 79 6f 75 20  |rovided. If you |
000044e0  6d 61 6b 65 20 61 6e 79  0a 63 68 61 6e 67 65 73  |make any.changes|
000044f0  20 77 68 69 63 68 20 79  6f 75 20 74 68 69 6e 6b  | which you think|
00004500  20 70 65 6f 70 6c 65 20  6d 69 67 68 74 20 66 69  | people might fi|
00004510  6e 64 20 75 73 65 66 75  6c 2c 20 6f 72 20 79 6f  |nd useful, or yo|
00004520  75 20 66 69 6e 64 20 61  6e 79 20 62 75 67 73 2c  |u find any bugs,|
00004530  0a 70 6c 65 61 73 65 20  65 2d 6d 61 69 6c 20 6d  |.please e-mail m|
00004540  65 20 61 6e 64 20 74 65  6c 6c 20 6d 65 20 61 62  |e and tell me ab|
00004550  6f 75 74 20 69 74 2e 0a  0a 54 68 61 6e 6b 73 20  |out it...Thanks |
00004560  67 6f 20 74 6f 20 53 74  65 77 61 72 74 20 42 72  |go to Stewart Br|
00004570  6f 64 69 65 20 66 6f 72  20 61 73 73 69 73 74 61  |odie for assista|
00004580  6e 63 65 20 77 69 74 68  20 76 73 70 72 69 6e 74  |nce with vsprint|
00004590  66 20 3b 2d 29 2e 0a 0a  0a 3d 3d 3d 3d 3d 3d 3d  |f ;-)....=======|
000045a0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
000045e0  3d 3d 3d 3d 3d 0a 4f 70  74 69 6f 6e 73 0a 2d 2d  |=====.Options.--|
000045f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00004630  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0a 0a 54 68 65 20  |----------..The |
00004640  6f 70 74 69 6f 6e 73 20  66 69 6c 65 20 69 73 20  |options file is |
00004650  73 74 6f 72 65 64 20 61  73 20 21 53 79 73 4c 6f  |stored as !SysLo|
00004660  67 2e 4f 70 74 69 6f 6e  73 2e 20 45 61 63 68 20  |g.Options. Each |
00004670  6c 69 6e 65 20 6f 66 20  74 68 65 20 6f 70 74 69  |line of the opti|
00004680  6f 6e 73 20 66 69 6c 65  0a 73 70 65 63 69 66 69  |ons file.specifi|
00004690  65 73 20 74 68 65 20 6f  70 74 69 6f 6e 73 20 66  |es the options f|
000046a0  6f 72 20 61 20 73 69 6e  67 6c 65 20 6c 6f 67 2e  |or a single log.|
000046b0  20 54 68 69 73 20 6c 69  6e 65 20 69 73 20 6f 66  | This line is of|
000046c0  20 74 68 65 20 66 6f 72  6d 61 74 3a 0a 20 20 20  | the format:.   |
000046d0  20 3c 6c 6f 67 6e 61 6d  65 3e 20 5b 52 65 73 65  | <logname> [Rese|
000046e0  72 76 65 20 3c 73 69 7a  65 3e 7c 4e 6f 52 65 73  |rve <size>|NoRes|
000046f0  65 72 76 65 5d 20 5b 53  65 73 73 69 6f 6e 73 7c  |erve] [Sessions||
00004700  4e 6f 53 65 73 73 69 6f  6e 73 5d 0a 20 20 20 20  |NoSessions].    |
00004710  20 20 20 20 20 20 20 20  20 20 5b 3c 6c 65 76 65  |          [<leve|
00004720  6c 3e 20 5b 3c 6d 61 78  2e 20 73 69 7a 65 3e 5d  |l> [<max. size>]|
00004730  5d 0a 3c 73 69 7a 65 3e  20 61 6e 64 20 3c 6d 61  |].<size> and <ma|
00004740  78 2e 20 73 69 7a 65 3e  20 61 72 65 20 73 70 65  |x. size> are spe|
00004750  63 69 66 69 65 64 20 69  6e 20 6b 69 6c 6f 62 79  |cified in kiloby|
00004760  74 65 73 2e 0a 0a 41 6e  20 65 6e 74 72 79 20 66  |tes...An entry f|
00004770  6f 72 20 6c 6f 67 20 22  2a 22 20 69 73 20 74 72  |or log "*" is tr|
00004780  65 61 74 65 64 20 61 73  20 74 68 65 20 64 65 66  |eated as the def|
00004790  61 75 6c 74 20 76 61 6c  75 65 73 2c 20 77 68 69  |ault values, whi|
000047a0  63 68 20 61 72 65 20 75  73 65 64 20 69 66 0a 74  |ch are used if.t|
000047b0  68 65 20 6c 6f 67 20 64  6f 65 73 6e 27 74 20 68  |he log doesn't h|
000047c0  61 76 65 20 61 20 73 70  65 63 69 66 69 63 20 65  |ave a specific e|
000047d0  6e 74 72 79 20 69 6e 20  74 68 65 20 4f 70 74 69  |ntry in the Opti|
000047e0  6f 6e 73 20 66 69 6c 65  2e 20 53 6f 2c 20 66 6f  |ons file. So, fo|
000047f0  72 20 65 78 61 6d 70 6c  65 2c 0a 74 6f 20 73 70  |r example,.to sp|
00004800  65 63 69 66 79 20 22 4e  6f 53 65 73 73 69 6f 6e  |ecify "NoSession|
00004810  73 22 20 66 6f 72 20 65  76 65 72 79 20 6c 6f 67  |s" for every log|
00004820  20 65 78 63 65 70 74 20  22 4e 65 77 73 42 69 74  | except "NewsBit|
00004830  65 22 20 79 6f 75 20 63  6f 75 6c 64 20 75 73 65  |e" you could use|
00004840  3a 0a 20 20 2a 20 4e 6f  53 65 73 73 69 6f 6e 73  |:.  * NoSessions|
00004850  0a 20 20 4e 65 77 73 42  69 74 65 20 53 65 73 73  |.  NewsBite Sess|
00004860  69 6f 6e 73 0a 0a 54 68  65 20 6f 70 74 69 6f 6e  |ions..The option|
00004870  73 20 68 61 76 65 20 74  68 65 20 66 6f 6c 6c 6f  |s have the follo|
00004880  77 69 6e 67 20 6d 65 61  6e 69 6e 67 73 3a 0a 0a  |wing meanings:..|
00004890  20 20 52 65 73 65 72 76  65 20 3c 73 69 7a 65 3e  |  Reserve <size>|
000048a0  0a 20 20 20 20 53 79 73  4c 6f 67 20 77 69 6c 6c  |.    SysLog will|
000048b0  20 6d 61 6b 65 20 73 75  72 65 20 74 68 61 74 20  | make sure that |
000048c0  61 74 20 6c 65 61 73 74  20 3c 73 69 7a 65 3e 20  |at least <size> |
000048d0  4b 42 20 6f 66 20 64 69  73 6b 20 73 70 61 63 65  |KB of disk space|
000048e0  20 69 73 20 66 72 65 65  20 66 6f 72 0a 20 20 20  | is free for.   |
000048f0  20 74 68 69 73 20 6c 6f  67 2c 20 62 79 20 70 61  | this log, by pa|
00004900  64 64 69 6e 67 20 74 68  65 20 6c 6f 67 20 66 69  |dding the log fi|
00004910  6c 65 20 77 69 74 68 20  7a 65 72 6f 73 20 77 68  |le with zeros wh|
00004920  69 63 68 20 61 72 65 20  6c 61 74 65 72 20 6f 76  |ich are later ov|
00004930  65 72 77 72 69 74 74 65  6e 0a 20 20 20 20 62 79  |erwritten.    by|
00004940  20 74 68 65 20 72 65 61  6c 20 6c 6f 67 20 64 61  | the real log da|
00004950  74 61 2e 0a 20 20 4e 6f  52 65 73 65 72 76 65 0a  |ta..  NoReserve.|
00004960  20 20 20 20 53 79 73 4c  6f 67 20 77 6f 6e 27 74  |    SysLog won't|
00004970  20 72 65 73 65 72 76 65  20 64 69 73 6b 20 73 70  | reserve disk sp|
00004980  61 63 65 20 66 6f 72 20  74 68 69 73 20 6c 6f 67  |ace for this log|
00004990  20 61 73 20 64 65 73 63  72 69 62 65 64 20 61 62  | as described ab|
000049a0  6f 76 65 2e 20 54 68 69  73 20 69 73 0a 20 20 20  |ove. This is.   |
000049b0  20 74 68 65 20 64 65 66  61 75 6c 74 2e 0a 0a 20  | the default... |
000049c0  20 53 65 73 73 69 6f 6e  73 0a 20 20 20 20 53 79  | Sessions.    Sy|
000049d0  73 4c 6f 67 20 77 69 6c  6c 20 75 73 65 20 53 65  |sLog will use Se|
000049e0  73 73 69 6f 6e 20 4c 6f  67 73 20 66 6f 72 20 74  |ssion Logs for t|
000049f0  68 69 73 20 6c 6f 67 20  28 61 73 20 64 65 73 63  |his log (as desc|
00004a00  72 69 62 65 64 20 61 62  6f 76 65 29 20 77 68 65  |ribed above) whe|
00004a10  72 65 0a 20 20 20 20 69  6e 73 74 72 75 63 74 65  |re.    instructe|
00004a20  64 2e 20 54 68 69 73 20  69 73 20 74 68 65 20 64  |d. This is the d|
00004a30  65 66 61 75 6c 74 2e 0a  20 20 4e 6f 53 65 73 73  |efault..  NoSess|
00004a40  69 6f 6e 73 0a 20 20 20  20 53 65 73 73 69 6f 6e  |ions.    Session|
00004a50  20 4c 6f 67 73 20 61 72  65 20 64 69 73 61 62 6c  | Logs are disabl|
00004a60  65 64 20 66 6f 72 20 74  68 69 73 20 6c 6f 67 2c  |ed for this log,|
00004a70  20 61 6e 64 20 6c 6f 67  20 65 6e 74 72 69 65 73  | and log entries|
00004a80  20 77 69 6c 6c 20 61 70  70 65 61 72 0a 20 20 20  | will appear.   |
00004a90  20 73 74 72 69 63 74 6c  79 20 69 6e 20 63 68 72  | strictly in chr|
00004aa0  6f 6e 6f 6c 6f 67 69 63  61 6c 20 6f 72 64 65 72  |onological order|
00004ab0  2e 0a 0a 20 20 3c 6c 65  76 65 6c 3e 0a 20 20 20  |...  <level>.   |
00004ac0  20 53 79 73 4c 6f 67 20  77 69 6c 6c 20 69 67 6e  | SysLog will ign|
00004ad0  6f 72 65 20 6c 6f 67 20  65 6e 74 72 69 65 73 20  |ore log entries |
00004ae0  66 6f 72 20 74 68 69 73  20 6c 6f 67 20 77 68 69  |for this log whi|
00004af0  63 68 20 68 61 76 65 20  61 20 70 72 69 6f 72 69  |ch have a priori|
00004b00  74 79 0a 20 20 20 20 67  72 65 61 74 65 72 20 74  |ty.    greater t|
00004b10  6f 20 6f 72 20 65 71 75  61 6c 20 74 68 61 6e 20  |o or equal than |
00004b20  74 68 69 73 20 76 61 6c  75 65 2e 20 54 68 65 20  |this value. The |
00004b30  64 65 66 61 75 6c 74 20  76 61 6c 75 65 20 69 73  |default value is|
00004b40  20 31 32 35 2e 0a 0a 20  20 3c 6d 61 78 2e 20 73  | 125...  <max. s|
00004b50  69 7a 65 3e 0a 20 20 20  20 54 68 65 20 6c 6f 67  |ize>.    The log|
00004b60  20 77 69 6c 6c 20 62 65  20 6d 6f 76 65 64 20 74  | will be moved t|
00004b70  6f 20 74 68 65 20 22 4f  6c 64 22 20 64 69 72 65  |o the "Old" dire|
00004b80  63 74 6f 72 79 20 77 68  65 6e 20 69 74 20 62 65  |ctory when it be|
00004b90  63 6f 6d 65 73 20 6c 61  72 67 65 72 0a 20 20 20  |comes larger.   |
00004ba0  20 74 68 61 6e 20 74 68  69 73 20 73 69 7a 65 2e  | than this size.|
00004bb0  20 54 68 65 20 64 65 66  61 75 6c 74 20 76 61 6c  | The default val|
00004bc0  75 65 20 69 73 20 32 35  36 4b 42 2e 0a 0a 0a 3d  |ue is 256KB....=|
00004bd0  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
*
00004c10  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 0a 55 73 61 67  |===========.Usag|
00004c20  65 20 67 75 69 64 65 6c  69 6e 65 73 0a 2d 2d 2d  |e guidelines.---|
00004c30  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00004c70  2d 2d 2d 2d 2d 2d 2d 2d  2d 0a 0a 50 72 65 76 69  |---------..Previ|
00004c80  6f 75 73 6c 79 20 69 6e  20 74 68 69 73 20 73 65  |ously in this se|
00004c90  63 74 69 6f 6e 20 49 20  72 65 63 6f 6d 6d 65 6e  |ction I recommen|
00004ca0  64 65 64 20 74 68 61 74  20 70 72 6f 67 72 61 6d  |ded that program|
00004cb0  73 20 73 68 6f 75 6c 64  20 6e 6f 74 20 66 61 69  |s should not fai|
00004cc0  6c 20 74 6f 0a 77 6f 72  6b 20 69 66 20 6c 6f 67  |l to.work if log|
00004cd0  67 69 6e 67 20 69 73 20  6e 6f 74 20 61 76 61 69  |ging is not avai|
00004ce0  6c 61 62 6c 65 2e 20 54  68 69 73 20 69 73 20 72  |lable. This is r|
00004cf0  65 61 73 6f 6e 61 62 6c  65 20 2d 20 68 6f 77 65  |easonable - howe|
00004d00  76 65 72 20 74 68 65 72  65 20 61 72 65 0a 76 65  |ver there are.ve|
00004d10  72 79 20 66 65 77 20 72  65 61 73 6f 6e 73 20 74  |ry few reasons t|
00004d20  68 61 74 20 6c 6f 67 67  69 6e 67 20 77 69 6c 6c  |hat logging will|
00004d30  20 66 61 69 6c 2c 20 61  6e 64 20 61 6c 6c 20 6f  | fail, and all o|
00004d40  66 20 74 68 65 73 65 20  72 65 61 73 6f 6e 73 20  |f these reasons |
00004d50  61 72 65 20 76 65 72 79  0a 6c 69 6b 65 6c 79 20  |are very.likely |
00004d60  74 6f 20 63 61 75 73 65  20 74 68 65 20 6d 61 69  |to cause the mai|
00004d70  6e 20 66 75 6e 63 74 69  6f 6e 20 6f 66 20 74 68  |n function of th|
00004d80  65 20 70 72 6f 67 72 61  6d 20 74 6f 20 66 61 69  |e program to fai|
00004d90  6c 2e 20 49 20 77 6f 75  6c 64 20 73 75 67 67 65  |l. I would sugge|
00004da0  73 74 0a 74 68 65 72 65  66 6f 72 65 20 74 68 61  |st.therefore tha|
00004db0  74 20 70 72 6f 67 72 61  6d 73 20 73 68 6f 75 6c  |t programs shoul|
00004dc0  64 20 52 4d 45 6e 73 75  72 65 20 74 68 65 20 53  |d RMEnsure the S|
00004dd0  79 73 4c 6f 67 20 6d 6f  64 75 6c 65 20 69 6e 20  |ysLog module in |
00004de0  74 68 65 69 72 20 21 52  75 6e 0a 66 69 6c 65 73  |their !Run.files|
00004df0  2c 20 61 6e 64 20 74 68  65 6e 20 75 73 65 20 69  |, and then use i|
00004e00  74 20 61 73 20 61 6e 79  20 6f 74 68 65 72 20 53  |t as any other S|
00004e10  57 49 2e 0a 0a 45 72 72  6f 72 73 20 66 72 6f 6d  |WI...Errors from|
00004e20  20 53 79 73 4c 6f 67 20  53 57 49 73 2c 20 77 68  | SysLog SWIs, wh|
00004e30  69 6c 65 20 73 74 72 69  63 74 6c 79 20 73 70 65  |ile strictly spe|
00004e40  61 6b 69 6e 67 20 6e 6f  6e 2d 66 61 74 61 6c 20  |aking non-fatal |
00004e50  66 6f 72 20 74 68 65 20  6d 61 69 6e 0a 70 72 6f  |for the main.pro|
00004e60  67 72 61 6d 2c 20 61 72  65 20 69 6e 64 69 63 61  |gram, are indica|
00004e70  74 69 76 65 20 6f 66 20  73 6f 6d 65 74 68 69 6e  |tive of somethin|
00004e80  67 20 62 65 69 6e 67 20  62 61 64 6c 79 20 77 72  |g being badly wr|
00004e90  6f 6e 67 20 77 69 74 68  20 74 68 65 20 73 79 73  |ong with the sys|
00004ea0  74 65 6d 2e 20 55 73 65  0a 27 58 27 20 53 57 49  |tem. Use.'X' SWI|
00004eb0  73 20 69 6e 20 73 69 74  75 61 74 69 6f 6e 73 20  |s in situations |
00004ec0  73 75 63 68 20 61 73 20  6d 6f 64 75 6c 65 73 20  |such as modules |
00004ed0  77 68 65 72 65 20 79 6f  75 20 68 61 76 65 20 74  |where you have t|
00004ee0  6f 2c 20 6f 66 20 63 6f  75 72 73 65 2c 20 62 75  |o, of course, bu|
00004ef0  74 20 69 6e 0a 61 70 70  6c 69 63 61 74 69 6f 6e  |t in.application|
00004f00  20 63 6f 64 65 20 77 68  65 72 65 20 79 6f 75 20  | code where you |
00004f10  68 61 76 65 20 61 6e 20  65 72 72 6f 72 20 68 61  |have an error ha|
00004f20  6e 64 6c 65 72 2c 20 79  6f 75 20 6d 69 67 68 74  |ndler, you might|
00004f30  20 61 73 20 77 65 6c 6c  20 75 73 65 20 74 68 65  | as well use the|
00004f40  0a 6e 6f 6e 2d 27 58 27  20 66 6f 72 6d 20 61 6e  |.non-'X' form an|
00004f50  64 20 74 72 65 61 74 20  74 68 65 20 65 72 72 6f  |d treat the erro|
00004f60  72 73 20 61 73 20 79 6f  75 20 77 6f 75 6c 64 20  |rs as you would |
00004f70  61 6e 79 20 6f 74 68 65  72 2e 0a 0a 50 72 6f 67  |any other...Prog|
00004f80  72 61 6d 73 20 77 68 69  63 68 20 75 73 65 20 53  |rams which use S|
00004f90  79 73 4c 6f 67 20 73 68  6f 75 6c 64 20 52 4d 45  |ysLog should RME|
00004fa0  6e 73 75 72 65 20 69 74  20 69 6e 20 74 68 65 69  |nsure it in thei|
00004fb0  72 20 21 52 75 6e 20 66  69 6c 65 73 2e 20 54 68  |r !Run files. Th|
00004fc0  65 0a 73 75 67 67 65 73  74 65 64 20 6c 69 6e 65  |e.suggested line|
00004fd0  73 20 74 6f 20 75 73 65  20 61 72 65 20 61 73 20  |s to use are as |
00004fe0  66 6f 6c 6c 6f 77 73 3a  0a 0a 49 66 20 22 3c 53  |follows:..If "<S|
00004ff0  79 73 4c 6f 67 24 44 69  72 3e 22 3d 22 22 20 74  |ysLog$Dir>"="" t|
00005000  68 65 6e 20 45 72 72 6f  72 20 21 53 79 73 4c 6f  |hen Error !SysLo|
00005010  67 20 61 70 70 6c 69 63  61 74 69 6f 6e 20 6e 6f  |g application no|
00005020  74 20 73 65 65 6e 20 62  79 20 66 69 6c 65 72 0a  |t seen by filer.|
00005030  52 4d 45 6e 73 75 72 65  20 53 79 73 4c 6f 67 20  |RMEnsure SysLog |
00005040  30 2e 31 36 20 52 75 6e  20 3c 53 79 73 4c 6f 67  |0.16 Run <SysLog|
00005050  24 44 69 72 3e 2e 21 52  75 6e 0a 52 4d 45 6e 73  |$Dir>.!Run.RMEns|
00005060  75 72 65 20 53 79 73 4c  6f 67 20 30 2e 31 36 20  |ure SysLog 0.16 |
00005070  45 72 72 6f 72 20 4d 79  41 70 70 20 6e 65 65 64  |Error MyApp need|
00005080  73 20 53 79 73 4c 6f 67  20 30 2e 31 36 20 6f 72  |s SysLog 0.16 or|
00005090  20 6c 61 74 65 72 0a 0a  4e 6f 74 65 20 74 68 61  | later..Note tha|
000050a0  74 20 79 6f 75 20 73 68  6f 75 6c 64 20 2a 6e 6f  |t you should *no|
000050b0  74 2a 20 6a 75 73 74 20  52 4d 4c 6f 61 64 20 74  |t* just RMLoad t|
000050c0  68 65 20 53 79 73 4c 6f  67 20 6d 6f 64 75 6c 65  |he SysLog module|
000050d0  2c 20 61 73 20 69 74 20  72 65 71 75 69 72 65 73  |, as it requires|
000050e0  20 69 74 73 0a 57 69 6d  70 20 74 61 73 6b 20 74  | its.Wimp task t|
000050f0  6f 20 62 65 20 61 63 74  69 76 61 74 65 64 2c 20  |o be activated, |
00005100  61 6e 64 20 74 68 69 73  20 77 69 6c 6c 20 6e 6f  |and this will no|
00005110  74 20 68 61 70 70 65 6e  20 69 66 20 79 6f 75 20  |t happen if you |
00005120  6a 75 73 74 20 52 4d 4c  6f 61 64 20 74 68 65 0a  |just RMLoad the.|
00005130  6d 6f 64 75 6c 65 2e 20  54 68 65 20 6d 6f 64 75  |module. The modu|
00005140  6c 65 20 68 61 73 20 61  20 74 77 6f 2d 73 74 61  |le has a two-sta|
00005150  67 65 20 61 70 70 6c 69  63 61 74 69 6f 6e 20 65  |ge application e|
00005160  6e 74 72 79 20 70 6f 69  6e 74 2c 20 73 6f 20 69  |ntry point, so i|
00005170  74 20 77 69 6c 6c 0a 72  65 74 75 72 6e 20 69 6d  |t will.return im|
00005180  6d 65 64 69 61 74 65 6c  79 20 77 68 65 6e 20 79  |mediately when y|
00005190  6f 75 20 52 4d 52 75 6e  20 69 74 2c 20 61 6c 6c  |ou RMRun it, all|
000051a0  6f 77 69 6e 67 20 74 68  65 20 21 52 75 6e 20 66  |owing the !Run f|
000051b0  69 6c 65 20 74 6f 20 63  6f 6e 74 69 6e 75 65 20  |ile to continue |
000051c0  61 73 0a 6e 6f 72 6d 61  6c 2e 0a                 |as.normal..|
000051cb