def on_events(*events):
    """ 
    Register a method for callback when any of the given events are emitted, 
    by adding an entry in the class' events dict.

    The class the method belongs to must inherit from PluginBase.
    
    :param events: string or iterable containing names of events to listen to
    """
    if (isinstance(events, str)):
        events = (events,)
    def decorator(function):
        function.subscribe_to = events
        return function

    return decorator