def init_logging(logfile=None, loglevel=logging.INFO, configfile=None):
<EOL>use_configfile = False<EOL>if configfile and os.path.exists(configfile):<EOL><INDENT>testcfg = ConfigParser()<EOL>read = testcfg.read(configfile)<EOL>use_configfile = (read and testcfg.has_section('<STR_LIT>'))<EOL><DEDENT>if use_configfile:<EOL><INDENT>logging.config.fileConfig(configfile)<EOL>if logfile:<EOL><INDENT>msg = "<STR_LIT>"<EOL>logging.warn(msg)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>format = '<STR_LIT>'<EOL>if logfile:<EOL><INDENT>logging.basicConfig(<EOL>filename=logfile, level=loglevel, format=format)<EOL><DEDENT>else:<EOL><INDENT>logging.basicConfig(level=loglevel, format=format)<EOL><DEDENT><DEDENT>
Configures the logging using either basic filename + loglevel or passed config file path.

This is performed separately from L{init_config()} in order to support the case where 
logging should happen independent of (usu. *after*) other aspects of the configuration 
initialization. For example, if logging may need to be initialized within a  daemon 
context.

@param logfile: An explicitly specified logfile destination.  If this is specified in addition
                to default logging, a warning will be issued.
@type logfile: C{str}

@param loglevel: Which level to use when logging to explicitly specified file or stdout.
@type loglevel: C{int}

@param configfile: The path to a configuration file.  This takes precedence over any explicitly
                    specified logfile/loglevel (but a warning will be logged if both are specified).
                    If the file is not specified or does not exist annd no logfile was specified, 
                    then the default.cfg configuration file will be used to initialize logging.
@type configfile: C{str}