Skip to content

[MP][Refactor] Move logging to common - #6781

Open
thegoldenflow wants to merge 1 commit into
LMCache:devfrom
thegoldenflow:mp-common-logging
Open

thegoldenflow wants to merge 1 commit into
LMCache:devfrom
thegoldenflow:mp-common-logging

Conversation

@thegoldenflow

@thegoldenflow thegoldenflow commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Part of #6758.

Moves lmcache/logging.py to lmcache/v1/common/logging.py unchanged (a 100% rename) and switches every reference to the new path: 256 modules, 4 tests, 2 example scripts, 8 notebooks, 4 docs including the zh_CN .po, and 2 .claude/skills files. 277 files, +277/−277. import lmcache, the client, the server and the CLI all create their loggers with init_logger, and the module only needs the standard library. The old path is not kept.

Outside users of the old path

  • LMCache/LMCache_inprocess (141 files) and LMCache/lmcache_l2_plugins (autumn/adapter.py:34): I'll send matching changes.
  • LMCache/LMCache-Ascend (47 files): I'll open an issue with the list.
  • rannnayy/LMCache@get-query-tensor-v2, which snapkv_colab.ipynb installs, needs a rebase before that notebook runs again.
  • 44 of the 730 open PRs add a lmcache.logging import (2026-11-20 01:20 UTC). Git shows no conflict, so each needs a one-line change per file when it merges dev.
  • vLLM imports init_logger from lmcache.utils, which still works.

If you'd rather keep the old path for a release, a two-line re-export in lmcache/logging.py would do, as #6485 did for MemoryLayoutDesc.

Special notes for your reviewers:

AI-assisted change; the submitter reviews every line before this leaves draft.

Every changed line only swaps lmcache.logging for lmcache.v1.common.logging; isort moved the line in 73 files. Same as dev: the backend registry in both import orders, pytest --collect-only tests (9081 IDs), and pytest on 317 test files (4906 passed, 266 skipped, per test ID). pre-commit passes. On a clean export import lmcache.logging raises ModuleNotFoundError, and import logging still returns the standard library. The runtime checks ran on the first commit; the second only changes one line in snapkv_colab.ipynb.

#6763 changes the import block next to this one in 17 files; whichever lands second rebases. For #6582: lmcache.logging can leave the client wheel's temporary list.

AI-generated PR explainer (required when AI-generated code is included):
pr-explainer-ffc3ba1b.html

If applicable:

  • this PR contains user facing changes - docs added
  • this PR contains unit tests
Before marking ready for review
  • I reviewed every changed line since the latest update, including generated or
    agent-assisted changes.
  • I ran the relevant local checks and recorded the commands and results above.
  • I confirmed the description matches the final diff and documents any missing coverage
    or compatibility concerns.
  • I confirmed every commit has a DCO Signed-off-by trailer.
  • I stated whether AI assistance was used in Special notes for your reviewers.
  • If AI-generated code is included, this PR is a draft and its title, description, and
    bilingual HTML explainer all match the current head.
  • The HTML explainer is detailed enough for a reviewer without prior context, and its
    diagrams, optional motion, code walkthrough, and test rationale match the implementation.

Move lmcache/logging.py to lmcache/v1/common/logging.py and update every
reference: imports, docs, the zh_CN catalog, examples and notebooks.
Client and server code both create their loggers with init_logger, and
the module only needs the standard library (OpenTelemetry is optional).
The file itself is unchanged and the old path is not re-exported.
isort moves the import line in 73 files; nothing else changes.
examples/token_dropping/snapkv_colab.ipynb keeps the old import because
it installs a fork that only has lmcache/logging.py.

Signed-off-by: Jason Yao <wsyjh8@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant