<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_logger(self, logger_name, level, handler=None):
 """ Sets the level of a logger """

        if 'loggers' not in self.config:
            self.config['loggers'] = {}
        real_level = self.real_level(level)
        self.config['loggers'][logger_name] = {'level': real_level}
        if handler:
            self.config['loggers'][logger_name]['handlers'] = [handler]