class_docstr: File storage class for Journal log backend.
  
  Args:
      file_path:
          Path of file to persist the log to.
  
      lock_obj:
          Lock object for process exclusivity.
class_docstr_tok: ["File","storage","class","for","Journal","log","backend",".","Args",":","file_path",":","Path","of","file","to","persist","the","log","to",".","lock_obj",":","Lock","object","for","process","exclusivity","."]
code: def __init__(
      self,
      file_path: str,
      lock_obj: Optional[JournalFileBaseLock] = None,
  ) -> None:
      self._file_path: str = file_path
      self._lock = lock_obj or JournalFileSymlinkLock(self._file_path)
      if not os.path.exists(self._file_path):
          open(
              self._file_path, "ab"
          ).close()  # Create a file if it does not exist
      self._log_number_offset: Dict[int, int] = {0: 0}
  
imports: import abc
  from contextlib import contextmanager
  import errno
  import json
  import os
  import time
  from typing import Any
  from typing import Dict
  from typing import Iterator
  from typing import List
  from typing import Optional
  import uuid
  from optuna.storages._journal.base import BaseJournalLogStorage
label_desc: Use image node_id 1 to create a new JournalFileStorage object from inherited base classes: BaseJournalLogStorage with example: obj = JournalFileStorage(file_path, lock_obj)