def __init__(self, file_path, config, log_config, log_attributes=None, file_system=None, checkpoint=None):
        if file_system is None:
            file_system = FileSystem()
        if log_attributes is None:
            log_attributes = {}

        self.__path = file_path
        # To mimic the behavior of the old agent which would use the ``thread_id`` feature of the Scalyr API to
        # group all events from the same log file together, we associate a thread_id (and thread_name) for each
        # LogFileProcessors.  We really should fix this at some point because thread_ids do not persist across sessions
        # which will mean all the vents from a single logical log file will not be put together (when an agent restart
        # happens).  However, this is how the old agent worked and the UI relies on it, so we just keep the old system
        # going for now.
        self.__thread_name = 'Lines for file %s' % file_path
        self.__thread_id = LogFileProcessor.generate_unique_thread_id()

        self.__log_file_iterator = LogFileIterator(file_path, config, log_config, file_system=file_system,
                                                   checkpoint=checkpoint)

        # Trackers whether or not close has been invoked on this processor.
        self.__is_closed = False

        # The base event that will be used to insert all events from this log.
        self.__base_event = Event(thread_id=self.__thread_id, attrs=log_attributes)
        # The redacter to perform on all log lines from this log file.
        self.__redacter = LogLineRedacter(file_path)
        # The sampler to apply to all log lines from this log file.
        self.__sampler = LogLineSampler(file_path)

        # The lock that must be held when reading all status related fields and __is_closed.
        self.__lock = threading.Lock()
        # The following fields are tracked for generating status information.
        self.__total_bytes_copied = 0L
        self.__total_bytes_skipped = 0L   # Bytes that had to be skipped due to falling too far behind in the log.
        self.__total_bytes_failed = 0L    # Bytes that could not be sent up to server.
        self.__total_bytes_dropped_by_sampling = 0L
        self.__total_bytes_pending = 0L  # The number of bytes that haven't been processed from the log file yet.
        self.__total_bytes_being_processed = 0L  # The number of bytes that are currently being processed.

        self.__total_lines_copied = 0L
        self.__total_lines_dropped_by_sampling = 0L

        self.__total_redactions = 0L

        # the count of sampling and redaction rules. Used to detect when there are none.
        self.__num_redaction_and_sampling_rules = 0

        # The last time the log file was checked for new content.
        self.__last_scan_time = None

        self.__copy_staleness_threshold = config.copy_staleness_threshold  # Defaults to 15 * 60

        self.__max_existing_log_offset_size = config.max_existing_log_offset_size  # Defaults to 100 * 1024 * 1024

        # if we don't have a checkpoint or if the checkpoint doesn't contain pending files
        # then we assume this is a new file and we only go back at most max_log_offset_size bytes
        if checkpoint is None or 'pending_files' not in checkpoint:
            self.__max_log_offset_size = config.max_log_offset_size  # Defaults to 5 * 1024 * 1024
        else:
            # otherwise this is an existing file so we can go back at most
            # max_existing_log_offset_size bytes
            self.__max_log_offset_size = self.__max_existing_log_offset_size

        self.__last_success = None
Initializes an instance.
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/log_processing.py/LogFileProcessor.__init__