public override bool Notify(Exception ex, string humaneMsg) { var exMsg = ExceptionMsg.Build(ex, humaneMsg); var rtnResult = ShowMessageBox(exMsg); LogToFile.WriteMsg(exMsg); return(rtnResult); }
public void LogMsg() { var logService = new LogToFile(); var dir = new GenLib.Services.DirectoryFile().GetFullyQualifiedDirectory(logService.GetFullPathFilename()); Console.WriteLine("TestLogMsg() directory is " + dir); new GenLib.Services.DirectoryFile().DeleteDirectoryWithFiles(dir); // verify that directory has been deleted Assert.False(Directory.Exists(dir)); // now finally test the message logging logService.WriteMsg("TestLogMsg"); Assert.True(File.Exists(logService.GetFullPathFilename())); Assert.True(true); }
public void ApplicationDataDir() { var logService = new LogToFile(); logService.SetLogFileLocationToLocalAppData(Assembly.GetExecutingAssembly().GetName().Name); var dir = Path.GetDirectoryName(logService.GetFullPathFilename()); Console.WriteLine("TestLogMsg() directory is " + dir); new GenLib.Services.DirectoryFile().DeleteDirectoryWithFiles(dir); // verify that directory has been deleted Assert.False(Directory.Exists(dir)); // now finally test the message logging logService.WriteMsg("TestLogMsg"); Assert.True(File.Exists(logService.GetFullPathFilename())); Assert.True(true); }
public override bool Notify(Exception ex, string humaneMsg) { return(LogToFile.WriteMsg(ExceptionMsg.Build(ex, humaneMsg))); }