This is an old revision of the document!
write a timestamped message to the log.
write log (message to log)
color (black/blue/green/red/none)
none will write to the log file but will not display in the log window
In addition to the program provided colors listed above if you pass a string containing an RGB or web color that will be used to color the text line in the window and the log line in the file if you are saving the log file as an RTF file.
monospaced adding “with monospaced” will write to the log in a monospaced font easier to line up columns if you’re debugging something interesting.
to if you specify a file reference here the log line will also be appended to the file specified. Use this to create special logs of just the info you’re interested in or write specific info to different places.
always showing if you include “with always showing” it will show in all log windows regardless of the display or filter settings.
write log "your mother was a hamster" write log "and your father..." color green write log “this will be orange!” color “FF7722” write log “this is monospaced for debugging” with monospaced set myFile to ((path to desktop folder) as text) & “mySpecialLog.txt” write log “this is my special log file” to myFile
when writing to a separate log file it will be up to you to manage and roll these files as appropriate and make sure you’re not writing so much that you fill your hard drive and cause other problems. No rolling or file management is performed on special files at all.
version 9.1 added support for the “always showing” parameter