code: def configure_logger(level: int | str = logging.INFO) -> None:
      """Get console logger by name.
  
      Args:
          level (int | str, optional): Logger Level. Defaults to logging.INFO.
  
      Returns:
          Logger: The expected logger.
      """
  
      if isinstance(level, str):
          level = logging.getLevelName(level)
  
      format_string = (
          "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
      )
      logging.basicConfig(format=format_string, level=level)
  
      # Set Pytorch Lightning logs to have a the consistent formatting with anomalib.
      for handler in logging.getLogger("pytorch_lightning").handlers:
          handler.setFormatter(logging.Formatter(format_string))
          handler.setLevel(level)
  
file_path: anomalib/src/anomalib/utils/loggers/__init__.py
imports: from __future__ import annotations
  import logging
  import os
  import warnings
  from pathlib import Path
  from typing import Iterable
  from omegaconf.dictconfig import DictConfig
  from omegaconf.listconfig import ListConfig
  from pytorch_lightning.loggers import CSVLogger, Logger
  from .comet import AnomalibCometLogger
  from .tensorboard import AnomalibTensorBoardLogger
  from .wandb import AnomalibWandbLogger
label_desc: Use image node_id 1 for calling a global function with example usage: configure_logger(level) without return types