コード例 #1
0
        public void RunProcessAndSendLogToAdmin()
        {
            EmailLogger emailLogger = new EmailLogger();

            try
            {
                //Run process
            }
            catch (Exception ex)
            {
                emailLogger.LogMessage(ex.Message);
            }
        }
コード例 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!!");
            var fileLogger = new FileSystemLogger();

            fileLogger.LogMessage(DateTime.Now.ToString() + " : Hello World has been executed");

            var emailLogger = new EmailLogger();

            emailLogger.LogMessage(DateTime.Now.ToString() + " : Hello World has been executed");

            Console.ReadKey();
        }