static void Main(string[] args) { AbstractLogger loggerChain = GetChainOfLogger(); loggerChain.LogMessage(AbstractLogger.INFO, "information"); loggerChain.LogMessage(AbstractLogger.DEBUG, "debug information"); loggerChain.LogMessage(AbstractLogger.ERROR, "error information"); }
public void LogMessage(int inLevel, string inMessage) { if (this.level <= inLevel) { Write(inMessage); } if (nextLogger != null) { nextLogger.LogMessage(inLevel, inMessage); } }