# Path: resources/lib/common/logger.py
# def info(text):
#     xbmc.log('[{}] {}'.format(APP, text), xbmc.LOGINFO)


import functools
import time
import traceback
from resources.lib.common.logger import info
from __future__ import print_function, unicode_literals




def performance(name):
    def decorator(func):
        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            start = time.time()
            ret = func(*args, **kwargs)
            end = time.time()
            info('{0} took {1:.2f}ms'.format(name, (end - start) * 1000))
            return ret
        return wrapper
    return decorator


def try_catch(name):
    def decorator(func):
        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            try:
                return func(*args, **kwargs)
            except:

# Path: resources/lib/common/logger.py
# def info(text):
#     xbmc.log('[{}] {}'.format(APP, text), xbmc.LOGINFO)


# Path: resources/lib/debug.py
import functools
import time
import traceback
from resources.lib.common.logger import info

from __future__ import print_function, unicode_literals




def performance(name):
    def decorator(func):
        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            start = time.time()
            ret = func(*args, **kwargs)
            end = time.time()
            info('{0} took {1:.2f}ms'.format(name, (end - start) * 1000))
            return ret
        return wrapper
    return decorator


def try_catch(name):
    def decorator(func):
        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            try:
                return func(*args, **kwargs)
            except:

                info('error in {} | {}'.format(name, str(traceback.format_exc())))