code: def __init__(self, path: str):
      if not os.path.exists(path):
          os.makedirs(path)
      self.path = path
  
      now = self.get_log_time()
      latest_log: Union[Dict[str, Any], None] = None
      for _ in range(15):
          log_name = self.get_log_name(now)
          if os.path.exists(log_name):
              with open(log_name, "r") as flog:
                  latest_log = json.loads(
                      flog.readlines()[-1]
                  )  # get last log
              break
          now -= datetime.timedelta(days=1)
  
      if latest_log is None:
          self.global_token_pass = 0
      else:
          self.global_token_pass = latest_log["token pass"]
  
file_path: DeepKE/example/llm/CPM-Bee/src/cpm_live/utils/log.py
imports: import os
  import sys
  from typing import Any, Dict, Optional, Tuple, Union
  import datetime
  import json
  import logging
  import bmtrain
label_desc: Use image node_id 1 to create a new LogManager object  with example: obj = LogManager(path)