Chain-of-responsibility pattern: Difference between revisions

Content deleted Content added
Python example: type hint
Line 380:
next = None
 
def __init__(self, levels) -> None:
"""Initialize new logger.
 
Initialize new logger
ArgsArguments:
levels (list[str]): List of log levels.
"""
self.log_levels = []
Line 390 ⟶ 391:
self.log_levels.append(level)
 
def set_next(self, next_logger: Logger):
"""Set next responsible logger in the chain.
 
Set next responsible logger in the chain.
ArgsArguments:
next_logger (Logger): Next responsible logger.
Returns: Logger: Next responsible logger.
"""