def initialize(logger_name=LOGGER_NAME,<EOL>log_filename=LOG_FILENAME,<EOL>app_logging_level=APP_LOGGING_LEVEL,<EOL>dep_logging_level=DEP_LOGGING_LEVEL,<EOL>format=None,<EOL>logger_class=None,<EOL>handlers=[],<EOL>global_logger=True):
<EOL>if not format:<EOL><INDENT>format = "<STR_LIT>"+ "<STR_LIT>"<EOL><DEDENT>formatter = logging.Formatter(format)<EOL>if log_filename:<EOL><INDENT>logging.basicConfig(<EOL>level=dep_logging_level,<EOL>format=format,<EOL>filename=log_filename,<EOL>filemode='<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>logging.basicConfig(<EOL>level=dep_logging_level,<EOL>format=format)<EOL><DEDENT>if logger_class:<EOL><INDENT>original_class = logging.getLoggerClass()<EOL>logging.setLoggerClass(logger_class)<EOL>new_logger = logging.getLogger(logger_name)<EOL>logging.setLoggerClass(original_class)<EOL><DEDENT>else:<EOL><INDENT>new_logger = logging.getLogger(logger_name)<EOL><DEDENT>new_logger.setLevel(app_logging_level)  <EOL>if global_logger:<EOL><INDENT>global logger<EOL>logger = new_logger<EOL><DEDENT>for handler in handlers:<EOL><INDENT>handler.setFormatter(formatter)<EOL>handler.setLevel(app_logging_level)<EOL>new_logger.addHandler(handler)<EOL><DEDENT>return new_logger<EOL>
Constructs and initializes a `logging.Logger` object.

Returns :class:`logging.Logger` object.

:param logger_name: name of the new logger.
:param log_filename: The log file location :class:`str` or None.
:param app_logging_level: The logging level to use for the application.
:param dep_logging_level: The logging level to use for dependencies.
:param format: The format string to use :class: `str` or None.
:param logger_class: The logger class to use
:param handlers: List of handler instances to add.
:param global_logger: If true set threepio's global logger variable to this logger.