DEBUG Logs Persist Despite Setting INFO Level in `init_logger`
Describe the bug
DEBUG logs (e.g., "Rebuilt the input!" from vllm_adapter.py:660) keep showing up even after setting INFO level in lmcache/logging.py. Changed basicConfig and init_logger to INFO, but getEffectiveLevel() still reports 10 (DEBUG) for "lmcache_vllm" and "lmcache_vllm.vllm_adapter". Submodule loggers seem to ignore the parent level or get reset.
Are there any other ways to set the logger level?
To Reproduce
- Update
lmcache/logging.py:
import logging
logging.basicConfig(level=logging.INFO)
def init_logger(name: str) -> logging.Logger:
logger = logging.getLogger(name)
logger.setLevel(logging.INFO)
return logger
- Run offline_inference.py
LMCACHE_CONFIG_FILE=example.yaml CUDA_VISIBLE_DEVICES=0 python3 offline_inference.py
- Check levels:
print(logging.getLogger("lmcache_vllm").getEffectiveLevel()) # 10
print(logging.getLogger("lmcache_vllm.vllm_adapter").getEffectiveLevel()) # 10
- See DEBUG logs like:
DEBUG LMCache: Rebuilt the input! [2025-02-26 ...] -- .../vllm_adapter.py:660
Screenshot
Expected behavior
No DEBUG logs—only INFO and above with basicConfig(level=INFO) and logger.setLevel(logging.INFO).
Desktop lmcache 0.1.4 lmcache_vllm 0.6.2.3
hey @dequeueing Thanks for submitting the issue! Will take a look soon.
cc @YaoJiayi
This issue has been automatically marked as stale because it has not had activity within 60 days. It will be automatically closed if no further activity occurs within 30 days.
This issue has been automatically closed due to inactivity. Please feel free to reopen if you feel it is still relevant!