Logging
Sometimes it is very helpful to instrument the code with some output statements
and log that to a file. in ObjectStudio we use the statement #out, which can be
sent to a String and writes the content to the transcript. If you want to write
the content of the transcript to a file, you must specify the '-o' parameter at
the command line (e.g. 'ostudio.exe -iostudio.img -ologfile.txt').
Now with OS8 we introduce a new API:
GlobalDictionary>>setProgramWindowLog:
this way you can set the log file from Smalltalk and don't have to specify it at
the command line. The advantage is, even for longer running applications you can
now generate new log files every day. If you generate the name of the log file
and for example, add a timestampe to make sure, you get the most information
from your code.
The only thing you need to keep in mind is, those files get overwritten! The
code does not check, if the file already exists an appends the output. Instead
the file starts over again. It is the engineers reponsibility to make sure, you
don't overwrite your own logs. Just as the regular '-o' statement does too.
So, be careful.
Andreas
---------------------------------------------
Quis Custodiet Ipsos Custodes?