예제 #1
0
        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");
        }
예제 #2
0
 public void LogMessage(int inLevel, string inMessage)
 {
     if (this.level <= inLevel)
     {
         Write(inMessage);
     }
     if (nextLogger != null)
     {
         nextLogger.LogMessage(inLevel, inMessage);
     }
 }