mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
Fix FocusLogger dedup to use exact type match in litellm_logging.py
Use `type(cb) is FocusLogger` instead of `isinstance(cb, FocusLogger)` in both _init_custom_logger_compatible_class and get_custom_logger_compatible_class so that a VantageLogger already in _in_memory_loggers is not incorrectly returned for a "focus" lookup. This ensures users with both "vantage" and "focus" in success_callbacks get separate loggers for each export destination. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3cc2ccec4a
commit
4a9d03f1b1
1 changed files with 2 additions and 2 deletions
|
|
@ -3868,7 +3868,7 @@ def _init_custom_logger_compatible_class( # noqa: PLR0915
|
|||
from litellm.integrations.focus.focus_logger import FocusLogger
|
||||
|
||||
for callback in _in_memory_loggers:
|
||||
if isinstance(callback, FocusLogger):
|
||||
if type(callback) is FocusLogger: # exact match; exclude subclasses like VantageLogger
|
||||
return callback # type: ignore
|
||||
focus_logger = FocusLogger()
|
||||
_in_memory_loggers.append(focus_logger)
|
||||
|
|
@ -4250,7 +4250,7 @@ def get_custom_logger_compatible_class( # noqa: PLR0915
|
|||
from litellm.integrations.focus.focus_logger import FocusLogger
|
||||
|
||||
for callback in _in_memory_loggers:
|
||||
if isinstance(callback, FocusLogger):
|
||||
if type(callback) is FocusLogger: # exact match; exclude subclasses like VantageLogger
|
||||
return callback
|
||||
elif logging_integration == "vantage":
|
||||
from litellm.integrations.vantage.vantage_logger import VantageLogger
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue