Installs given logger in given module or default logger in caller introspected module.

    :param logger: Logger to install.
    :type logger: Logger
    :param module: Module.
    :type module: ModuleType
    :return: Logger.
    :rtype: Logger

def install_logger(logger=None, module=None):
    """
    Installs given logger in given module or default logger in caller introspected module.

    :param logger: Logger to install.
    :type logger: Logger
    :param module: Module.
    :type module: ModuleType
    :return: Logger.
    :rtype: Logger
    """

    logger = logging.getLogger(Constants.logger) if logger is None else logger
    if module is None:
        # Note: inspect.getmodule() can return the wrong module if it has been imported with different relatives paths.
        module = sys.modules.get(inspect.currentframe().f_back.f_globals["__name__"])
    setattr(module, "LOGGER", logger)

    foundations.trace.register_module(module)

    return logger