code: def serve_logs(port=None):
      """Serve logs generated by Worker."""
      setproctitle("airflow serve-logs")
      wsgi_app = create_app()
  
      port = port or conf.getint("logging", "WORKER_LOG_SERVER_PORT")
  
      # If dual stack is available and IPV6_V6ONLY is not enabled on the socket
      # then when IPV6 is bound to it will also bind to IPV4 automatically
      if getattr(socket, "has_dualstack_ipv6", lambda: False)():
          bind_option = GunicornOption("bind", f"[::]:{port}")
      else:
          bind_option = GunicornOption("bind", f"0.0.0.0:{port}")
  
      options = [bind_option, GunicornOption("workers", 2)]
      StandaloneGunicornApplication(wsgi_app, options).run()
  
file_path: airflow/airflow/utils/serve_logs.py
imports: from __future__ import annotations
  import logging
  import os
  import socket
  from collections import namedtuple
  import gunicorn.app.base
  from flask import Flask, abort, request, send_from_directory
  from jwt.exceptions import ExpiredSignatureError, ImmatureSignatureError, InvalidAudienceError, InvalidIssuedAtError, InvalidSignatureError
  from setproctitle import setproctitle
  from airflow.configuration import conf
  from airflow.utils.docs import get_docs_url
  from airflow.utils.jwt_signer import JWTSigner
  from airflow.utils.module_loading import import_string
label_desc: Use image node_id 2 for calling a global function with example usage: serve_logs(port) without return types