def METHOD_NAME(logger: logging.Logger = None):
    """Logs the traceback.
    If secure mode is set, the traceback only includes file names, line numbers and func names;
    and only the type of the exception.
    If secure mode is not set, the traceback will be logged normally as traceback.print_exc().
    Args:
       logger: if not None, this logger is used to log the traceback detail. If None, the root logger will be used.
    """
    exc_detail = secure_format_traceback()
    if not logger:
        logger = logging.getLogger()
    logger.error(exc_detail)