'Helper for quickly adding a StreamHandler to the logger. Useful for debugging.
:param handler:
:param level:
:return: the handler after adding it'

@staticmethod
def enable_logging(level=logging.DEBUG, handler=None):

    if (not handler):
        if (GCM.logging_handler is None):
            GCM.logging_handler = logging.StreamHandler()
            GCM.logging_handler.setFormatter(logging.Formatter('[%(asctime)s    -    %(levelname)s    -    %(filename)s:%(lineno)s    -    %(funcName)s()]    %(message)s'))
        handler = GCM.logging_handler
    GCM.logger = logging.getLogger(__name__)
    GCM.logger.removeHandler(handler)
    GCM.logger.addHandler(handler)
    GCM.logger.setLevel(level)
    GCM.log('Added    a    stderr    logging    handler    to    logger:    {0}', __name__)
    requests_logger_name = 'requests.packages.urllib3'
    requests_logger = logging.getLogger(requests_logger_name)
    requests_logger.removeHandler(handler)
    requests_logger.addHandler(handler)
    requests_logger.setLevel(level)
    GCM.log('Added    a    stderr    logging    handler    to    logger:    {0}', requests_logger_name)
