def __init__(self, folder, callback, file_pattern=["*.log"], includeSubFolder=False, excludeFileListFile=None, tail_lines=0,
                       sizehint=1048576):
        """Arguments:

        (str) @folder:
            the folder to watch

        (callable) @callback:
            a function which is called every time one of the file being
            watched is updated;
            this is called with "filename" and "lines" arguments.

        (list) @file_pattern:
            only watch files with these file_pattern

        (list) @includeSubFolder:
            only watch the given folder, or watch all sub-folders under the given folder

        (str)excludeFileListFile:
            in this list file, it contains the excluded log files. each line is for each excluded log file(absolute file path)
            The argument is very useful if we monitor one big folder for long time, it can reduce log scan cost

        (int) @tail_lines:
            read last N lines from files being watched before starting

        (int) @sizehint: passed to file.readlines(), represents an
            approximation of the maximum number of bytes to read from
            a file on every ieration (as opposed to load the entire
            file in memory until EOF is reached). Defaults to 1MB.
        """
        self.folder = os.path.realpath(folder)
        self.file_pattern = file_pattern
        self.includeSubFolder=includeSubFolder
        self.excludeFileListFile=excludeFileListFile
        self._files_map = {}
        self._callback = callback
        self._sizehint = sizehint
        assert os.path.isdir(self.folder), self.folder
        assert callable(callback), repr(callback)
        self.update_files()
        for id, file in self._files_map.items():
            file.seek(os.path.getsize(file.name))  # EOF
            if tail_lines:
                try:
                    lines = self.tail(file.name, tail_lines)
                except __HOLE__ as err:
                    if err.errno != errno.ENOENT:
                        raise
                else:
                    if lines:
                        self._callback(file.name, lines)
dataset/ETHPy150Open harryliu/edwin/edwinAgent/site_packages/logwatch_glob.py/LogWatcher.__init__