code: def log_lr(self, key: str, lr: float, state: TrainerState) -> None:
      if self.metrics_log_path is None:
          return None
      with open(self.metrics_log_path, "a") as f:
          f.write(f" lr : {fix_float_to_length(lr, 12)} |\n")
      self.metrics_log_path = None
  
imports: import os
  import json
  import time
  import shutil
  import getpass
  import platform
  from typing import Any
  from typing import Dict
  from typing import Optional
  from cftool.misc import lock_manager
  from cftool.misc import print_warning
  from cftool.misc import fix_float_to_length
  from ..schema import ITrainer
  from ..schema import StepOutputs
  from ..schema import TrainerState
  from ..schema import MetricsOutputs
  from ..schema import TrainerCallback
  from ..constants import PT_PREFIX
  from ..constants import SCORES_FILE
label_desc: Use image node_id 3 for calling the _LogMetricsMsgCallback obj's underlying member method code with example usage: obj.log_lr(key, lr, state) and returns: None