opik icon indicating copy to clipboard operation
opik copied to clipboard

[FR]: Python SDK enables changing console log level

Open ryanli-me opened this issue 10 months ago • 2 comments

Proposal summary

Hi there,

I've been a big fan of opik over the last couple of days and I'm experimenting sending bigger volume tracing to opik. I saw my console keeps logging HTTP request. I couldn't find how to set log level to warning. I tried the following but didn't work.

opik_logger = logging.getLogger("opik")
opik_logger.setLevel(logging.WARNING)

I see there's a parameter in config but there's no way to set it https://github.com/comet-ml/opik/blob/b853496764a8d4b318005b3f8a35871d5ca046b7/sdks/python/src/opik/config.py#L132

Thanks!

Motivation

No response

ryanli-me avatar Feb 08 '25 17:02 ryanli-me

Hi @ryanli-me , try setting environment variable OPIK_CONSOLE_LOGGING_LEVEL=WARNING before importing Opik. (same principle with adding OPIK_ prefix will work for any other config value as well)

alexkuzmik avatar Feb 08 '25 17:02 alexkuzmik

@alexkuzmik Can we update the documentation to make it clearer on how to change the log levels, then we can close this one

jverre avatar Feb 28 '25 10:02 jverre