next up previous 107
Next: Temporary and intermediate files
Up: Writing a Primitive
Previous: Writing a Primitive


Log Files

It is sometimes desirable to write results to log files as data files are processed (for example, seeing statistics, pointing offsets etc). Rather than force the primitive writer to check for the existence of log files and decide whether or not to open or append to log files, the ORAC-DR system provides a simplified access to log file creation via the ORAC:LogFile class.

All that is required to write an entry to a log file is for the following methods to be invoked:

my $log = new ORAC::LogFile('log.whatever');
$log->header(@header);
$log->addentry(@lines);
The header will only be written to the log file if the log file does not previously exist so it is safe to run this command in a primitive without an explicit check. Both the header() and addentry() methods accept arrays, and newline characters will be appended to each item in the array when written to the log file. The convention is that all log file names should start with `log.'.



next up previous 107
Next: Temporary and intermediate files
Up: Writing a Primitive
Previous: Writing a Primitive

ORAC-DR -- Programmer's Guide
Starlink User Note 233
Tim Jenness, Frossie Economou, Brad Cavanagh
Joint Astronomy Centre, Hilo, Hawaii
June 2004
E-mail:ussc@star.rl.ac.uk

Copyright © 2004 Particle Physics and Astronomy Research Council