Logging and Debug Mode - madscatt/sasmol GitHub Wiki

Libraries should be light weight and error handling can largely be accomplished by the code calling the library method. Therefore, the default settings for the library do not include elaborate exception handling.

For development purposes one can edit sasmol/sasconfig.py to turn logging on by setting the sasconfig.logging variable to True. This is a global variable. Thus, in the methods that you are developing you need to import sasmol.sasconfig to access this functionality.

global __logging__
__logging__ = True

And thus in your module you would type:

import sasmol.sasconfig as sasconfig

and access the variable as

log_flag = sasconfig.__logging__