Example #1
0
    def wrapped(*args, **kwargs):
        operation = func.im_class.__name__
        logger.debug("Calling '{}'".format(operation))

        start = time()
        result = func(*args, **kwargs)
        total = time() - start

        if total > 1:
            logger.warn("Operation '{}' finished in {}s".format(
                operation, total))
        return result
Example #2
0
    def wrapped(*args, **kwargs):
        operation = func.im_class.__name__
        logger.debug("Calling '{}'".format(operation))

        start = time()
        result = func(*args, **kwargs)
        total = time() - start

        if total > 1:
            logger.warn("Operation '{}' finished in {}s"
                        .format(operation, total))
        return result
 def handle(self, *args, **kwargs):
     version_msg = "Current SX Console version: {}".format(version)
     try:
         resp = requests.get(
             'http://cdn.skylable.com/check/sxconsole-lite-version')
     except Exception as e:
         msg = version_msg + ".\nFailed to check for updates. Error: {}."
         logger.error(msg.format(e))
         return
     if resp.ok:
         msg = version_msg + ", latest version: {}"
         logger.info(msg.format(resp.text))
     else:
         msg = version_msg + ". Failed to check for updates ({}). "
         logger.warn(msg.format(resp.status_code))
 def handle(self, *args, **kwargs):
     version_msg = "Current SX Console version: {}".format(version)
     try:
         resp = requests.get(
             'http://cdn.skylable.com/check/sxconsole-lite-version')
     except Exception as e:
         msg = version_msg + ".\nFailed to check for updates. Error: {}."
         logger.error(msg.format(e))
         return
     if resp.ok:
         msg = version_msg + ", latest version: {}"
         logger.info(msg.format(resp.text))
     else:
         msg = version_msg + ". Failed to check for updates ({}). "
         logger.warn(msg.format(resp.status_code))