class_docstr: Base class for log writers, triggered at every reset and step by finite env.
  
  What to do with a specific log depends on the implementation of subclassing :class:`LogWriter`.
  The general principle is that, it should handle logs above its loglevel (inclusive),
  and discard logs that are not acceptable. For instance, console loggers obviously can't handle an image.
class_docstr_tok: ["Base","class","for","log","writers",",","triggered","at","every","reset","and","step","by","finite","env",".","What","to","do","with","a","specific","log","depends","on","the","implementation","of","subclassing",":","class",":","`","LogWriter","`",".","The","general","principle","is","that",",","it","should","handle","logs","above","its","loglevel","(","inclusive",")",",","and","discard","logs","that","are","not","acceptable",".","For","instance",",","console","loggers","obviously","ca","n't","handle","an","image","."]
docstr: Clear all the metrics for a fresh start.
  To make the logger instance reusable.
code: def clear(self):
      """Clear all the metrics for a fresh start.
      To make the logger instance reusable.
      """
      self.episode_count = self.step_count = 0
      self.active_env_ids = set()
  
imports: from __future__ import annotations
  import logging
  from collections import defaultdict
  from enum import IntEnum
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Callable, Dict, Generic, List, Sequence, Set, Tuple, TypeVar
  import numpy
  import pandas
  from qlib.log import get_module_logger
label_desc: Use image node_id 2 for calling the LogWriter obj's underlying member method code with example usage: obj.clear() without return types