On this Page

    _logfEx

    Format a line of text and write it to the current logfile with a severity level.

    Syntax

    _logfEx(severity, format[, p1[, p2 ...]])

    Parameters

    severity can be one of INFO, WARN, ERROR, or FATAL. Actually, only the first character (case insensitive) matters. If it is not recognized, INFO is used.

    format is a template of the text to be written to the file. It is similar to a C-format string where embedded %s, %d, and %f markers that get replaced by parameters passed to _logf. For a more complete description of the formatting process, see _printf.

    p1, p2, ... are the optional parameters to be substituted into the format string.

    Returned Value

    None

    Description

    The _logf function formats a message and writes it to the current logfile. There is also a _logPrintf function which writes the same message to both the logfile and console.

    And there is a _dlogf function which is exactly the same as _logf except that it will write out to the log only if -debug has been set. See Debugging Script

    Example

     _logfEx("WARN","name=%s, city=%s", "Tony", "Paris");  // writes 'name=Tony, city=Paris' 

    See Also

    fp.fprintf
    _message
    _printf
    _sprintf
    _tracef
    Debugging Script