Esempio n. 1
0
        static void Main(string[] args)
        {
            var conslog  = new ConsoleLogWriter();
            var textlog  = new FileLogWriter();
            var conslog1 = new ConsoleLogWriter();
            var textlog1 = new FileLogWriter();

            conslog.LogInfo("Some information about the program");
            textlog.LogError("Some information about the error in the program");
            conslog1.LogInfo("Warning about possible problems in the program");
            textlog1.LogError("Some information about the error in the program");
            var multi = new MultipleLogWriter(new AbstractLogWriter[] { conslog, textlog, conslog1, textlog1 });
        }
Esempio n. 2
0
        static void Main()
        {
            var cons = new ConsoleLogWriter();

            cons.LogWarning("ВОт ЭТО ОШИБКа");
            cons.LogError("Err");
            cons.LogInfo("ИНфо");
            var file = new FileLogWriter();

            file.LogWarning("ВОт ЭТО ОШИБКа");
            file.LogError("Err");
            file.LogInfo("ИНфо");
            var mult = new MultipleLogWriter(cons, file);

            mult.LogInfo("конлсь инфо");
            mult.LogWarning("конлсь варнинг");
            mult.LogError("конлсь ерор");
            Console.ReadKey();
        }
Esempio n. 3
0
 public void LogInfo(string message)
 {
     fileLogWriterObject.LogInfo(message);
     consoleLogWriterObject.LogInfo(message);
 }