Due to the nature of refineGEMs (being a toolbox), it would be helpful to have a consistent logger that can be accessed and viewed from other tools that call functions from refinegems and not have everything being written to the root logger.
A good solution might be to write a logger with the Python logging module that can be imported from every module in refinegems, similar to COBRApy or Memote.
❕When implementing logging, keep in mind to handle exceptions correctly.
Modules
gapfill (with note as logging option if something is between info and warning)
db_access
set_up -> e.g. file size in ..utility.set_up.download_url, out put of DIAMOND calls
- ...
Notes
-
one logger for all modules or one for each submodule? Hierarchical? -> Important: correct propagation
-
maybe add some decorator for special logging cases --> BUT: see above (how to log in hierachical logger?)
-
Idea: do it similarly to COBRApy?
-
Coloured text could be used for logging:
from colorama import init as colorama_init
from colorama import Fore
def coloured_example_text():
colorama_init(autoreset=True)
print(f'{Fore.RED}To use the KEGG comparison the specification of the organismid (KEGG organism code) is obligatory.\n' +
'If there is no organism code available for your organism in KEGG but an entry for your organism exists in BioCyc, use the option \'BioCyc\'.\n' +
'If no entry for your organism exists in KEGG and/or BioCyc, the gap analysis cannot be done.')
Due to the nature of refineGEMs (being a toolbox), it would be helpful to have a consistent logger that can be accessed and viewed from other tools that call functions from refinegems and not have everything being written to the root logger.
A good solution might be to write a logger with the Python logging module that can be imported from every module in refinegems, similar to COBRApy or Memote.
❕When implementing logging, keep in mind to handle exceptions correctly.
Modules
gapfill(with note as logging option if something is between info and warning)db_accessset_up-> e.g. file size in..utility.set_up.download_url, out put of DIAMOND callsNotes
one logger for all modules or one for each submodule? Hierarchical? -> Important: correct propagation
maybe add some decorator for special logging cases --> BUT: see above (how to log in hierachical logger?)
Idea: do it similarly to COBRApy?
Coloured text could be used for logging: