You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Standard output (messages) writing is currently used inconsistently (for example, sometimes using sys.write(), others with print() ).
Every message or result specifc output (like the output pareto front, or motif statistics) should be using print() function. Other messages should use the python 'logging' module. Logger.info() for messages that are expected, Logger.critical() when the program errors and terminates, and Logger.warning( ) for anything else.
At the same time, add a check for a verbosity level for each Logger and print. Having the verbosity as a string would allow more flexibility to the user. An idea:
i = info
w = warning
s = stats
r = results
d = debug - Also print the source location of the message
The user provides a string with these tags (e.g. "isr" for everything except warnings) and logging is only done for those in the string. Critical level messages are always printed, unless there's a good reason not to.
Logger should be configured as:
import logging
if "l" in options.verbosity:
FORMAT = '[%(filename)s:%(lineno)s - %(funcName)20s() ] %(asctime)15s - %(levelname)s : %(message)s'
else:
FORMAT = '%(asctime)15s - %(levelname)s : %(message)s'
logging.basicConfig(format=FORMAT)
logger = logging.getLogger(__name__)
and messages logged with:
if` "w" in options.verbosity:
logger.warning("The warning message")
This change should not be made for standalone scripts, this is only for motifgp.py and its classes.
The text was updated successfully, but these errors were encountered:
Standard output (messages) writing is currently used inconsistently (for example, sometimes using sys.write(), others with print() ).
Every message or result specifc output (like the output pareto front, or motif statistics) should be using print() function. Other messages should use the python 'logging' module. Logger.info() for messages that are expected, Logger.critical() when the program errors and terminates, and Logger.warning( ) for anything else.
At the same time, add a check for a verbosity level for each Logger and print. Having the verbosity as a string would allow more flexibility to the user. An idea:
i = info
w = warning
s = stats
r = results
d = debug - Also print the source location of the message
The user provides a string with these tags (e.g. "isr" for everything except warnings) and logging is only done for those in the string. Critical level messages are always printed, unless there's a good reason not to.
Logger should be configured as:
and messages logged with:
This change should not be made for standalone scripts, this is only for motifgp.py and its classes.
The text was updated successfully, but these errors were encountered: