comet-ml / issue-tracking

Questions, Help, and Issues for Comet ML
https://www.comet.ml
85 stars 7 forks source link

How can I set log_level in Experiment? #510

Closed ricardofurbino-nas closed 11 months ago

ricardofurbino-nas commented 1 year ago

Before Asking:

What is your question related to?

What is your question?

How can I set log_level in experiment? I'm deploying an app in GCP Functions and, even though it is with log level WARN, I keep getting comet's log level INFO.

Code

This how I'm setting logs.

import logging
import google.cloud.logging
from comet_ml import Experiment

client = google.cloud.logging.Client()
client.setup_logging(log_level=LOG_LEVEL)
dsblank commented 11 months ago

The comet logger is fairly sophisticated as it is triggered when comet_ml is imported. But there are a few settings that you can control through environment variables (or via the ~/.comet.config file):

COMET_LOGGING_CONSOLE
COMET_LOGGING_FILE_LEVEL

You can set one or the other of those to your desired level name, and should get the desired effects.

For more information, see: https://www.comet.com/docs/v2/api-and-sdk/python-sdk/advanced/configuration/#configuration-parameters