cancerDHC / sheet2linkml

Python package for conversion of Google Sheet to LinkML for CCDH
Apache License 2.0
1 stars 3 forks source link

Replace top-level logger with per-class loggers #19

Open gaurav opened 3 years ago

gaurav commented 3 years ago

At the moment, all logging in sheet2linkml is carried out by running e.g.:

logging.info(f"Google Sheet loaded: {model}")

The recommended way of using loggers is to create a context specific or per-class logger object and use that, i.e.

logger = logging.getLogger(__name__)
click_log.basic_config(logger)

# code for module

logger.info(f"Google Sheet loaded: {model}")

(Note the use of click-log to allow users to configure the logging from the command line, so we no longer have to include a logger.ini file)

I'm going to mark this low-priority, since the current scheme works for now. However, new code should definitely use this scheme, and we should probably find some time towards the end of this year or early next year to do this.

sujaypatil96 commented 3 years ago

This issue is perhaps best suited for the sheet2linkml repo, whenever that comes to fruition. I can take up the responsibility of integrating click-log with sheet2linkml, so I'm assigning this issue to myself.