How to do proper logging

Classic logger

You can initialize a classic logger if you want to log things that will be visible in the logs once deployed.

# Instanciate logger
logger = logging.getLogger(__name__)

SA Logger

We added a different logger, more specific to a SA that need of seeing things when doing local analysis, but with no need of seeing those logs in Datadog. This sa_logger will pretty print the given predictions to make them easily readable in the terminal. You can try it out using:

from deepomatic.workflows.v2.utils import sa_logger

sa_logger('METER READ PRED', meter_read_pred)

To see those logs you can add the flag --sa-logger to your wf_client run command.