/// <summary> /// Trace a PulsarException. /// </summary> /// <param name="ex">The PulsarException to trace.</param> public static void Trace(PulsarException ex) { if (ex.InnerException != null) { Trace(ex.InnerException); } Trace(ex.Source, ex.Message, TraceState.Error);//if we don't made this it's throw a stackoverflow ! ';..;' }
public void TracePulsarExceptionTest() { Logger.Initialize(path, application); PulsarException ex = new PulsarException(typeof(LoggerTest).FullName, "This is a message"); string[] files = Directory.GetFiles(path + "/" + application); Assert.AreEqual(1, files.Length); string content = File.ReadAllText(files[0], Encoding.UTF8); Assert.AreEqual(true, content.Contains(ex.Source)); Assert.AreEqual(true, content.Contains(ex.Message)); Assert.AreEqual(true, content.Contains(TraceState.Error.ToString())); }