<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def log(self, timer_name, node):
        ''' logs a event in the timer '''
        timestamp = time.time()
        if hasattr(self, timer_name):
            getattr(self, timer_name).append({
                "node":node,
                "time":timestamp})
        else:
            setattr(self, timer_name, [{"node":node, "time":timestamp}])