'Create a log file.
@param name: name of the file
@param directory: directory holding the file
@param defaultMode: permissions used to create the file. Default to
current permissions of the file if the file exists.'

def __init__(self, name, directory, defaultMode=None):

    self.directory = directory
    self.name = name
    self.path = os.path.join(directory, name)
    if ((defaultMode is None) and os.path.exists(self.path)):
        self.defaultMode = stat.S_IMODE(os.stat(self.path)[stat.ST_MODE])
    else:
        self.defaultMode = defaultMode
    self._openFile()
