def __init__(self, name=None, level=INFO, path=None, print_default=True, log_default=True, log_size=10485760, backup_count=5):
        """
        Create the rotating file logger. By default, the name will be set based
        on the inspection stack; the level will be set to INFO; and the path
        will be set to the class defaults.
        
        :param name: The name of the logger (e.g. "myprogram").
        :param level: The logging level for output.
        :param path: The directory to put the log file inside.
        :param print_default: Whether to default to outputting logging
                              information to stdout.
        :Param log_default: Whether to default to commiting logging information
                            to the log file.
        """
        # Did they specify a path?
        if path:
            # Make sure that the path ends with a slash. (It should point to a
            # directory, not a file).
            if not path.endswith('/'):
                path += '/'
        else:
            # See if we have privileges to write to the root log file and set
            # the destination accordingly.
            if os.access(os.path.dirname(ELEVATED_PATH[:-1]), os.W_OK):
                path = ELEVATED_PATH
            else:
                path = os.path.expanduser(LOCAL_PATH)
        
        # There needs to be a name. If none is provided, pull it from the
        # inspection stack. (It might not be pretty.)
        if not name:
            name = inspect.stack()[1][3]
        
        # Form the destination. All destinations will end in '.log'.
        destination = os.path.join(path, name)
        if not destination.endswith('.log'):
            destination += '.log'
        
        # Ensure that the necessary directories exist for creating the log file.
        if not os.path.exists(os.path.dirname(destination)):
            try:
                os.makedirs(os.path.dirname(destination))
            except __HOLE__:
                raise ValueError("Invalid path specified: could not create'{}'".format(str(os.path.dirname(destination))))
        
        # Call the super constructor.
        super(FileLogger, self).__init__(name=name, level=level, print_default=print_default, log_default=log_default)
        
        # Save the path (just in case).
        self.path = path
        
        # Set up the formatting and handling for this file logger.
        # This will be a rotating file logger, with up to five backup files each
        # weighing up to 10MB. Each line is prefaced with the timestamp, the
        # logging level, and the message. So
        #   logger.info("This is some test output!")
        # would produce a line as:
        #   2015-02-05 17:29:48,289 INFO: This is some test output!
        formatter = logging.Formatter('%(asctime)s %(levelname)s: %(message)s')
        handler   = logging.handlers.RotatingFileHandler(destination, maxBytes=log_size, backupCount=backup_count)
        handler.setFormatter(formatter)
        
        self.addHandler(handler)
dataset/ETHPy150Open univ-of-utah-marriott-library-apple/management_tools/management_tools/loggers.py/FileLogger.__init__