esrf

Beamline Instrument Software Support
SPEC Macro documentation: [ Macro Index | BCU Home ]

debug_log_file.mac
See other macros in category: Debugging
Description:
Documentation:
    DESCRIPTION
    Open a log file. At eache prompt, check the size of the log file. If size exceed the limit, the file is copied to another file with a .X extention. X in 1..N. You can define the number of files to use. if set to -1, files will not be deleted.

    EXAMPLE


    SETUP
    To put in your spec session setup:
    # 5 files of 1MB each
    dlf_setup("/buffer/mufid2.esrf.fr1/cyril/lll.dlog", 1000000, 5)
    # re init at each fresh restart
    if ( FRESH && !NOT_FIRST_SETUP_FRESH) {
    dlf_init()
    }


    DEPENDENCIES


Macros:
    dlf_setup
    Usage: dlf_setup (<file_name>, <max_size_in_Bytes>, <number_of_files>)
    - <file_name> : string : path + file name - <max_size_in_MB> : number : shifts log file when this limit is reached. - <max_files> : integer : -1 : do not delete files. N>0 : use N files : { f , f.1, f.2, ... , f.N-1}

    dlf_on
    Usage: dlf_on
    Enables log recording.

    dlf_off
    Usage: dlf_off
    Disables log recording.

    dlf_timestamp_current_logfile
    Usage: dlf_timestamp_current_logfile ()
    Makes a copy of current log file for post-mortem analysis.

    dlf_debug
    Usage: dlf_debug [<debug_level>]
    Activates or desactivates the printing of debug messages.

Internal Macros:
    dlf_init
    Usage: dlf_init ()
    To put in real fresh restart ?

    dlf_unsetup
    Usage: dlf_unsetup
    Remove all globals used and hiiked functions.

    dlf_test_log_file
    Usage: dlf_test_log_file ()
    Function called at each prompt to check the size of log file and shift it if needed.

    dlf_msg
    Usage: dlf_msg (<msg>)
    Prints a message in green.

    dlf_dbg
    Usage: dlf_dbg (<debug_msg>, <level>)
    Prints a debug message if debug level is activated.

    dlf_err
    Usage: dlf_err (<err_msg>)


Filename: debug_log_file.mac
Author:
Last mod.: 10/06/2011 16:05 by guilloud