Content deleted Content added
m →Java example: reverted method name to match other examples |
m change source to syntaxhighlight |
||
Line 53:
A logger is created using a chain of loggers, each one configured with different log levels.
<
import java.util.Arrays;
import java.util.EnumSet;
Line 117:
}
}
</syntaxhighlight>
=== C# example ===
This C# examples uses the logger application to select different sources based on the log level;
<
namespace ChainOfResponsibility
{
Line 261:
Sending via email: Order Dispatched.
*/
</syntaxhighlight>
=== Crystal example ===
<
enum LogLevel
None
Line 335:
# Handled by ConsoleLogger and EmailLogger
logger.message("Order Dispatched.", LogLevel::FunctionalMessage)
</syntaxhighlight>
Output
Line 352:
=== Python example ===
<
"""
Chain of responsibility pattern example.
Line 492:
if __name__ == "__main__":
main()
</syntaxhighlight>
== Implementations ==
|