code: def demonstrate_colored_logging():
      
      # Determine the available logging levels and order them by numeric value.
      decorated_levels = []
      defined_levels = coloredlogs.find_defined_levels()
      normalizer = coloredlogs.NameNormalizer()
      for name, level in defined_levels.items():
          if name != 'NOTSET':
              item = (level, normalizer.normalize_name(name))
              if item not in decorated_levels:
                  decorated_levels.append(item)
      ordered_levels = sorted(decorated_levels)
      # Initialize colored output to the terminal, default to the most
      # verbose logging level but enable the user the customize it.
      coloredlogs.install(level=os.environ.get('COLOREDLOGS_LOG_LEVEL', ordered_levels[0][1]))
      # Print some examples with different timestamps.
      for level, name in ordered_levels:
          log_method = getattr(logger, name, None)
          if log_method:
              log_method("message with level %s (%i)", name, level)
              time.sleep(DEMO_DELAY)
docs: Interactively demonstrate the :mod:`coloredlogs` package.