(*allargs)
Write a log message, if there is a log file.

    Even though this function is called initlog(), you should always
    use log(); log is a variable that is set either to initlog
    (initially), to dolog (once the log file has been opened), or to
    nolog (when logging is disabled).

    The first argument is a format string; the remaining arguments (if
    any) are arguments to the % operator, so e.g.
        log("%s: %s", "a", "b")
    will write "a: b" to the log file, followed by a newline.

    If the global logfp is not None, it should be a file object to
    which log data is written.

    If the global logfp is None, the global logfile may be a string
    giving a filename to open, in append mode.  This file should be
    world writable!!!  If the file can't be opened, logging is
    silently disabled (since there is no safe place where we could
    send an error message).
Write a log message, if there is a log file.
Write a log message if there is a log file .
def initlog(*allargs):
    """Write a log message, if there is a log file.

    Even though this function is called initlog(), you should always
    use log(); log is a variable that is set either to initlog
    (initially), to dolog (once the log file has been opened), or to
    nolog (when logging is disabled).

    The first argument is a format string; the remaining arguments (if
    any) are arguments to the % operator, so e.g.
        log("%s: %s", "a", "b")
    will write "a: b" to the log file, followed by a newline.

    If the global logfp is not None, it should be a file object to
    which log data is written.

    If the global logfp is None, the global logfile may be a string
    giving a filename to open, in append mode.  This file should be
    world writable!!!  If the file can't be opened, logging is
    silently disabled (since there is no safe place where we could
    send an error message).

    """
    global log, logfile, logfp
    warnings.warn("cgi.log() is deprecated as of 3.10. Use logging instead",
                  DeprecationWarning, stacklevel=2)
    if logfile and not logfp:
        try:
            logfp = open(logfile, "a", encoding="locale")
        except OSError:
            pass
    if not logfp:
        log = nolog
    else:
        log = dolog
    log(*allargs)
def initlog ( * allargs ) : global log , logfile , logfp warnings . warn ( "cgi.log() is deprecated as of 3.10. Use logging instead" , DeprecationWarning , stacklevel = 2 ) if logfile and not logfp : try : logfp = open ( logfile , "a" , encoding = "locale" ) except OSError : pass if not logfp : log = nolog else : log = dolog log ( * allargs )