def METHOD_NAME(self, win_id: int, register: str = None) -> None:
    """Start or stop recording a macro.
    Args:
        register: Which register to store the macro in.
    """
    if self._recording_macro is None:
        if register is None:
            mode_manager = modeman.instance(win_id)
            mode_manager.enter(usertypes.KeyMode.record_macro,
                               'record_macro')
        else:
            self.record_macro(register)
    else:
        message.info("Macro '{}' recorded.".format(self._recording_macro))
        self._recording_macro = None