Skip to content

Commit

Permalink
chore: use logger.warning instead of logger.warn (#904)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcklingen authored Sep 3, 2024
1 parent aac2ba9 commit 150f09b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions langfuse/decorators/langfuse_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,12 +518,12 @@ def get_current_llama_index_handler(self):
observation = _observation_stack_context.get()[-1]

if observation is None:
self._log.warn("No observation found in the current context")
self._log.warning("No observation found in the current context")

return None

if isinstance(observation, StatefulGenerationClient):
self._log.warn(
self._log.warning(
"Current observation is of type GENERATION, LlamaIndex handler is not supported for this type of observation"
)

Expand Down Expand Up @@ -552,12 +552,12 @@ def get_current_langchain_handler(self):
observation = _observation_stack_context.get()[-1]

if observation is None:
self._log.warn("No observation found in the current context")
self._log.warning("No observation found in the current context")

return None

if isinstance(observation, StatefulGenerationClient):
self._log.warn(
self._log.warning(
"Current observation is of type GENERATION, Langchain handler is not supported for this type of observation"
)

Expand Down Expand Up @@ -585,7 +585,7 @@ def get_current_trace_id(self):

if not stack:
if should_log_warning:
self._log.warn("No trace found in the current context")
self._log.warning("No trace found in the current context")

return None

Expand All @@ -595,7 +595,7 @@ def _get_caller_module_name(self):
try:
caller_module = inspect.getmodule(inspect.stack()[2][0])
except Exception as e:
self._log.warn(f"Failed to get caller module: {e}")
self._log.warning(f"Failed to get caller module: {e}")

return None

Expand Down Expand Up @@ -643,7 +643,7 @@ def get_current_observation_id(self):

if not stack:
if should_log_warning:
self._log.warn("No observation found in the current context")
self._log.warning("No observation found in the current context")

return None

Expand Down Expand Up @@ -690,7 +690,7 @@ def update_current_trace(
trace_id = self.get_current_trace_id()

if trace_id is None:
self._log.warn("No trace found in the current context")
self._log.warning("No trace found in the current context")

return

Expand Down Expand Up @@ -943,7 +943,7 @@ def flush(self):
if langfuse:
langfuse.flush()
else:
self._log.warn("No langfuse object found in the current context")
self._log.warning("No langfuse object found in the current context")

def configure(
self,
Expand Down Expand Up @@ -1002,7 +1002,7 @@ def _get_langfuse(self) -> Langfuse:

def _set_root_trace_id(self, trace_id: str):
if _observation_stack_context.get():
self._log.warn(
self._log.warning(
"Root Trace ID cannot be set on a already running trace. Skipping root trace ID assignment."
)
return
Expand Down
2 changes: 1 addition & 1 deletion langfuse/task_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def execute_task_with_backoff(batch: List[Any]):
and 400 <= int(e.status) < 500
and int(e.status) != 429
):
self._log.warn(
self._log.warning(
f"Received {e.status} error by Langfuse server, not retrying: {e.message}"
)
return
Expand Down

0 comments on commit 150f09b

Please sign in to comment.