;docformat = 'rst' ;+ ; The function provides useful logging information by providing the name of the routine ; from which it was called. For example if it was called from the get_data function of ; the file 'level_3a_daisy_server__define.pro' it would return ; '19-Feb-2016 22:16:08 LEVEL_3A_DAISY_SERVER::GET_DATA' ; where the time would be different each time this is run ; ; :Author: ; Bill Barrett ; ; :Params: ; ; :Returns: ; The name of the name of the pro / function that called this function ;- ; function get_routine_name ; Get the current system time, convert it to vms format, and trim off the ; field for the fraction of a second since that will always be '.00' time_tag = jd2vms(SYSTIME(/JULIAN, /UTC)) time_tag = strmid(time_tag, 0, strpos(time_tag, '.')) ; SCOPE_TRACEBACK returns an array of structures that are the calling tree ; The last element of the array "n_elements(scope) - 1" will be this module. ; The next to the last element of the array "n_elements(scope) - 2" will be ; what we want, the name of the file / module that called this. scope = SCOPE_TRACEBACK( /STRUCTURE) return, time_tag + ' ' + (n_elements(scope) ge 2 ? scope[n_elements(scope) - 2].routine : '') + ' ' end