def METHOD_NAME(self, record):
    if self.clear:
        record._stack_info_hidden, record.stack_info = record.stack_info, None
    elif hasattr(record, "_stack_info_hidden"):
        record.stack_info = record._stack_info_hidden
        del record._stack_info_hidden
    return True