public void RunProcessAndSendLogToAdmin() { EmailLogger emailLogger = new EmailLogger(); try { //Run process } catch (Exception ex) { emailLogger.LogMessage(ex.Message); } }
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(); }