commotion_client.utils.logger.LogHandler Class Reference
Inheritance diagram for commotion_client.utils.logger.LogHandler:
Public Member Functions | |
def | __init__ |
def | set_logfile |
def | set_verbosity |
def | get_logger |
Public Attributes | |
logger | |
levels | |
formatter | |
stream | |
file_handler | |
logfile | |
Detailed Description
Main logging controls for Commotion-Client. This application is ONLY to be called by the main application. This logger sets up the main namespace for all other logging to take place within. All other loggers should be the core string "commotion_client" and the packages __name__ to use inheretance from the main commotion package. This way the code in an indivdual extension will be small and will inheret the logging settings that were defined in the main application. Example Use for ALL other modules and packages: from commotion-client.utils import logger log = logger.getLogger("commotion_client"+__name__) NOTE: The exceptions in this function do not have translation implemented. This is that they are called before the QT application and, as such, are not pushed through QT's translation tools. This could be a mistake on the developers side, as he is a bit foggy on the specifics of QT translation. You can access the feature request at https://github.com/opentechinstitute/commotion-client/issues/24
Member Function Documentation
def commotion_client.utils.logger.LogHandler.set_logfile | ( | self, | |
logfile = None |
|||
) |
Set the file to log to. Args: logfile (string): The absolute path to the file to log to. optional: defaults to the default system logfile path.
References commotion_client.utils.logger.LogHandler.logfile.
80 raise NotADirectoryError("Attempted to set logging to the user's Commotion directory. The directory '<home>/.Commotion' does not exist and could not be created.")
88 raise NotADirectoryError("Attempted to set logging to the user's Commotion directory. The directory '<home>/.Commotion' does not exist and could not be created.")
def commotion_client.utils.logger.LogHandler.set_verbosity | ( | self, | |
verbosity = None , |
|||
log_type = None |
|||
) |
Set's the verbosity of the logging for the application. Args: verbosity (string|int): The verbosity level for logging to take place. optional: Defaults to "Error" level log_type (string): The type of logging whose verbosity is to be changed. optional: If not specified ALL logging types will be changed. Returns: bool True if successful, False if failed Raises: exception: Description.
References commotion_client.utils.logger.LogHandler.file_handler, commotion_client.utils.logger.LogHandler.formatter, commotion_client.utils.logger.LogHandler.levels, commotion_client.utils.logger.LogHandler.logfile, commotion_client.utils.logger.LogHandler.logger, commotion_client.commotion_client.CommotionClientApplication.logger, and commotion_client.utils.logger.LogHandler.stream.
The documentation for this class was generated from the following file:
- commotion_client/utils/logger.py