code: def instance_logger(
      instance: Identified, echoflag: _EchoFlagType = None
  ) -> None:
      """create a logger for an instance that implements :class:`.Identified`."""
  
      if instance.logging_name:
          name = "%s.%s" % (
              _qual_logger_name_for_cls(instance.__class__),
              instance.logging_name,
          )
      else:
          name = _qual_logger_name_for_cls(instance.__class__)
  
      instance._echo = echoflag  # type: ignore
  
      logger: Union[logging.Logger, InstanceLogger]
  
      if echoflag in (False, None):
          # if no echo setting or False, return a Logger directly,
          # avoiding overhead of filtering
          logger = logging.getLogger(name)
      else:
          # if a specified echo flag, return an EchoLogger,
          # which checks the flag, overrides normal log
          # levels by calling logger._log()
          logger = InstanceLogger(echoflag, name)
  
      instance.logger = logger
  
imports: from __future__ import annotations
  import logging
  import sys
  from typing import Any
  from typing import Optional
  from typing import overload
  from typing import Set
  from typing import Type
  from typing import TypeVar
  from typing import Union
  from .util import py311
  from .util.typing import Literal
label_desc: Use image node_id 4 for calling a global function with example usage: instance_logger(instance, echoflag) without return types