class_docstr: Hook to log by epoch.
  
  Args:
      logger (:class:`colossalai.logging.DistributedLogger`): Logger for recording the log information.
      interval (int, optional): Interval of printing log information, defaults to 1.
      priority (int, optional): Priority in the printing, hooks with small priority will be printed in front,
          defaults to 1. If different hooks share same priority, the order of printing would
          depend on the hooks order in the hook list.
class_docstr_tok: ["Hook","to","log","by","epoch",".","Args",":","logger","(",":","class",":","`","colossalai.logging.DistributedLogger","`",")",":","Logger","for","recording","the","log","information",".","interval","(","int",",","optional",")",":","Interval","of","printing","log","information",",","defaults","to","1.","priority","(","int",",","optional",")",":","Priority","in","the","printing",",","hooks","with","small","priority","will","be","printed","in","front",",","defaults","to","1",".","If","different","hooks","share","same","priority",",","the","order","of","printing","would","depend","on","the","hooks","order","in","the","hook","list","."]
code: def __init__(self, logger, interval: int = 1, priority: int = 1):
      super().__init__(priority)
      self.logger = logger
      self._interval = interval
  
imports: import os
  import os.path
  from typing import List
  from colossalai.legacy.context import ParallelMode
  from colossalai.legacy.core import global_context
  from colossalai.legacy.registry import HOOKS
  from colossalai.legacy.trainer.hooks._metric_hook import ThroughputMetric
  from colossalai.legacy.utils import is_dp_rank_0, is_no_pp_or_last_stage, is_tp_rank_0, report_memory_usage
  from colossalai.logging import DistributedLogger
  from colossalai.utils import MultiTimer
  from ._base_hook import BaseHook
  from ._commons_ import _format_number
label_desc: Use image node_id 1 to create a new LogByEpochHook object from inherited base classes: BaseHook with example: obj = LogByEpochHook(logger, interval, priority)