import functools
import traceback
import logging


def quiet_func(func):
    """
    Wrapper function which traces errors and returns None in case of exception.
    Otherwise returns function output.
    """
    @functools.wraps(func)
    def quiet_func_call(*args, **kwargs):
        try:
            return func(*args, **kwargs)
        except:
            args_ = str(locals())
            err = traceback.format_exc()
            logging.error(f'{args_} --- {err}')
            return None
    return quiet_func_call