message: chore(api): add logging to repl script
diff: @@ -7,6 +7,8 @@ and expose it to a python commandline.
  import os
  from functools import wraps
  import asyncio
  +import logging
  +from logging.config import dictConfig
  has_robot_server = True
  if os.environ.get("OPENTRONS_SIMULATION"):
  @@ -25,7 +27,6 @@ else:
  from code import interact # noqa: E402
  from subprocess import run # noqa: E402
  from typing import Union, Type, Any # noqa: E402
  -import logging # noqa: E402
  from opentrons.types import Mount, Point # noqa: E402
  from opentrons.hardware_control.types import Axis, CriticalPoint # noqa: E402
  @@ -47,6 +48,33 @@ from opentrons.hardware_control.ot3_calibration import ( # noqa: E402
  from opentrons.hardware_control.protocols import HardwareControlAPI # noqa: E402
  from opentrons.hardware_control.thread_manager import ThreadManager # noqa: E402
  +
  +log = logging.getLogger(__name__)
  +
  +LOG_CONFIG = {
  + "version": 1,
  + "disable_existing_loggers": False,
  + "formatters": {
  + "basic": {"format": "%(asctime)s %(name)s %(levelname)s %(message)s"}
  + },
  + "handlers": {
  + "file_handler": {
  + "class": "logging.handlers.RotatingFileHandler",
  + "formatter": "basic",
  + "filename": "/var/log/repl.log",
  + "maxBytes": 5000000,
  + "level": logging.DEBUG,
  + "backupCount": 3,
  + },
  + },
  + "loggers": {
  + "": {
  + "handlers": ["file_handler"],
  + "level": logging.DEBUG,
  + },
  + },
  +}
  +
  if ff.enable_ot3_hardware_controller():
  from opentrons.hardware_control.ot3api import OT3API
  @@ -107,6 +135,7 @@ def do_interact(api: ThreadManager[HardwareControlAPI]) -> None:
  if __name__ == "__main__":
  + dictConfig(LOG_CONFIG)
  if has_robot_server:
  stop_server()
  api_tm = build_api()
  