Пример #1
0
        static void Main(string[] args)
        {
            AbstractLogger logger = null;

            try
            {
                int b = 0;
                int i = 1 / b;
            }
            catch (Exception ex)
            {
                LogError err = new LogError();
                logger = new FileLogger(".\\log.txt");
                err.SetLogger(logger);
                err.Log(ex.Message);

                logger = new ConsoleLogger();
                err.SetLogger(logger);
                err.Log(ex.Message);
            }


            Console.ReadLine();
        }
Пример #2
0
 public void SetLogger(AbstractLogger logger)
 {
     this.logger = logger;
 }