logfire icon indicating copy to clipboard operation
logfire copied to clipboard

Error/Warning: Loguru Success Level Integration throws warning

Open bllchmbrs opened this issue 1 year ago • 0 comments

Description

Hey! Loving logfire so far... have a question.

I am getting this error (or rather, it's a warning).

UserWarning: Invalid log level name: 'level 25' warnings.warn(f'Invalid log level name: {level!r}')

While I am using loguru and logfire together.

I do not believe I am doing anything special with loguru at all - I am using all of the defaults and I don't completely understand how /why this is happening.

After looking at the loguru docs, it seems that level 25 is "success" in Loguru, but isn't recognized by logfire - this seems strange.

I believe this error triggers on logger.success calls.

Edit 1:

here's the repro:

import logfire
from loguru import logger

logger.configure(handlers=[logfire.loguru_handler()])
logger.success('Hello, {name}!', name='World')

Edit 2

Actually, this is worse than I thought. It throws an exception in the Logfire dashboard when I run loguru.success basically the opposite of what I want. below is how a "success" shows up. image

Python, Logfire & OS Versions, related packages (not required)

No response

bllchmbrs avatar May 11 '24 21:05 bllchmbrs