Beispiel #1
0
        public static void test()
        {
            AbstractLogger loggerChain = GetChainOfLoggers();

            loggerChain.LogMessage(AbstractLogger.INFO, "This is an information.");

            loggerChain.LogMessage(AbstractLogger.DEBUG, "This is a debug level information.");

            loggerChain.LogMessage(AbstractLogger.ERROR, "This is an error information.");
        }
Beispiel #2
0
 public void LogMessage(int level, String message)
 {
     if (this.Level <= level)
     {
         Write(message);
     }
     if (NextLogger != null)
     {
         NextLogger.LogMessage(level, message);
     }
 }