pro create_log_entry, logname, msg ;+ ;$Log: ; ; NAME: ; create_log_entry ; ; PURPOSE: ; Creates log entries when pipeline operations are executed ; ; CATEGORY: ; AMIE Calibration - part of the project 'amie_pipeline' ; ; CALLING SEQUENCE: ; create_log_entry, logname, message ; ; INPUTS: ; logname: string with the name of the log ; message: message to be inserted in the log ; ; OPTIONAL INPUT PARAMETERS: ; None. ; ; OUTPUTS: ; entry in the log ; ; COMMON BLOCKS: ; None. ; ; SIDE EFFECTS: ; Hopefully none. ; ; RESTRICTIONS: ; Log must have been initialized ; ; MODIFICATION HISTORY: ; 2004 Feb 16, MA: First version ; ; (c) 2004, Miguel Almeida, ESA/RSSD ;- ;----------------------------------------------------------------------------------------------------------------------- ; ;Check if the the log file name exits - it is possible to run the modules of the pipeline for test purposes without a ;log file. ; ;----------------------------------------------------------------------------------------------------------------------- if n_elements(logname) eq 0 then begin ;------------------------------------------------------------------------------------------------------------------- ;If the log file is not specified a message will be displayed in the screen print, 'Log file does not exist. Log file is not being created' ;------------------------------------------------------------------------------------------------------------------- endif else begin ;------------------------------------------------------------------------------------------------------------------- ;If the log file name is specified a log entry is created in that file ;------------------------------------------------------------------------------------------------------------------- ;------------------------------------------------------------------------------------------------------------------- ;Retrieve date and time in UTC from the system and put in the format YYYYMonDD_HHhMMmSSs date_time = string(FORMAT='(C(CYI,CMoA,CDI2.2,"_",CHI2.2, "h", CMI2.2,"m", CSI2.2,"s"))',SYSTIME(/julian,/utc)) ;------------------------------------------------------------------------------------------------------------------- openu, log_unit, logname, /append, /get_lun ;------------------------------------------------------------------------------------------------------------------- ;Create log entry with a time stamp printf, log_unit, '['+date_time+' UT ] ' + msg ;------------------------------------------------------------------------------------------------------------------- close, log_unit free_lun, log_unit endelse end