static void Main() { AbstractLogger loggerChain = getChainOfLoggers(); loggerChain.LogMessage(AbstractLogger.INFO, "This is an information."); loggerChain.LogMessage(AbstractLogger.DEBUG, "This is an debug level information."); loggerChain.LogMessage(AbstractLogger.ERROR, "This is an error information."); }
public static void Demo() { AbstractLogger lc = GetChainOfLoggers(); lc.LogMessage(AbstractLogger.INFO, "This is an information"); lc.LogMessage(AbstractLogger.DEBUG, "This is an debug information"); lc.LogMessage(AbstractLogger.ERROR, "This is an error information"); Console.ReadLine(); }
public void LogMessage(int level, string msg) { if (this.level <= level) { Write(msg); } if (NextLogger != null) { NextLogger.LogMessage(level, msg); } }