public void TestLogWithException() { oldStdOut = Console.Out; newStdOut = new StringWriter(); Console.SetOut(newStdOut); try { ICommunicatorLogger logger = SystemConsoleCommunicatorLogger.Instance; var exception = new Exception(); try { throw exception; } catch (Exception e) { logger.Log("Hello world", e); } var aString = newStdOut.ToString(); StringAssert.EndsWith("Hello world" + Environment.NewLine + exception.ToString() + Environment.NewLine, aString); } finally { Console.SetOut(oldStdOut); } }
public void TestLog() { oldStdOut = Console.Out; newStdOut = new StringWriter(); Console.SetOut(newStdOut); try { ICommunicatorLogger logger = SystemConsoleCommunicatorLogger.Instance; logger.Log("Hello world"); var aString = newStdOut.ToString(); StringAssert.EndsWith("Hello world" + Environment.NewLine, aString); } finally { Console.SetOut(oldStdOut); } }
public void EnableLogging(ICommunicatorLogger communicatorLogger) { Session.Connection.EnableLogging(communicatorLogger); }
public void EnableLogging(ICommunicatorLogger communicatorLogger) { // delegate to the communicator _communicator.EnableLogging(communicatorLogger); }
public void EnableLogging(ICommunicatorLogger communicatorLogger) { _communicatorLogger = communicatorLogger; }