Logging: for easy python debugging

Start logging

The following script allows a user to easily start logging

  • warnings to stdout
  • debug to a file

Logging is triggered using the using the standard logging module.

import logging
import pypersonalassistant.helpers

ppa_logger = pypersonalassistant.helpers.log()
logging.debug('START LOG')

Stop/pause logging

Logging can be easily disabled at any time

ppa_logger.disable()
...
ppa_logger.enable()

Customise logging

Details of the underlying logger object can be read or modified to change behaviour, via the logger attribute

ppa_logger.logger.setLevel(logging.INFO)