tag:help.appveyor.com,2012-11-13:/discussions/questions/1419-how-can-i-output-some-debug-data-during-an-xunit-testAppVeyor: Discussion 2018-10-19T08:17:17Ztag:help.appveyor.com,2012-11-13:Comment/372377612015-06-28T17:22:51Z2015-06-28T17:22:51ZHow can I output some debug data during an xunit test?<div><p>Console.WriteLine() should have supposed to work. Output should
be collected and shown along with test I test results page. If not
how does runner suppress it?</p>
<p>You can write/append to file and then include it to artifacts
thought it's not as elegant.</p>
<p>Btw, try Trace.* methods.</p>
<ul>
<li>Feodor</li>
</ul></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/372377612015-06-30T12:32:54Z2015-06-30T12:32:54ZHow can I output some debug data during an xunit test?<div><p>Hi Feodor.</p>
<p>Yeah, I would have thought so too.</p>
<p>Here's the public AV project: <a href="https://ci.appveyor.com/project/PureKrome/nlog-bugsnag">https://ci.appveyor.com/project/PureKrome/nlog-bugsnag</a><br>
I can't find any logged messages.</p>
<p>Here's the code (from an OSS project) which does the output
lines: <a href="https://github.com/PureKrome/NLog.Bugsnag/blob/dev/Code/Tests/BugSnagTargetTests.cs#L69-L71">
https://github.com/PureKrome/NLog.Bugsnag/blob/dev/Code/Tests/BugSn...</a></p>
<p>Not sure what's going wrong here - as in, why it's not printing
the debug text.</p>
<p>(note: i'm <em>not</em> setting the Configuration (eg.
<code>release</code> or <code>debug</code>) and it looks like it is
defaulting to Debug:</p>
<pre>
<code>ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".</code>
</pre></div>Pure Krometag:help.appveyor.com,2012-11-13:Comment/372377612015-06-30T17:10:16Z2015-06-30T17:10:16ZHow can I output some debug data during an xunit test?<div><p>But it actually fails on this line: <a href="https://github.com/PureKrome/NLog.Bugsnag/blob/dev/Code/Tests/BugSnagTargetTests.cs#L69">
https://github.com/PureKrome/NLog.Bugsnag/blob/dev/Code/Tests/BugSn...</a>
- <code>error</code> is null.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/372377612015-06-30T17:16:29Z2015-06-30T17:16:29ZHow can I output some debug data during an xunit test?<div><p><code>Console.WriteLine</code> goes to console: <a href="https://ci.appveyor.com/project/FeodorFitsner/xunit-20-tests/build/1.0.52#L139">
https://ci.appveyor.com/project/FeodorFitsner/xunit-20-tests/build/...</a></p>
<p>Test: <a href="https://github.com/FeodorFitsner/xunit-20-tests/blob/master/Xunit20Tests_AnyCPU/AnyCPU_Tests.cs#L21">
https://github.com/FeodorFitsner/xunit-20-tests/blob/master/Xunit20...</a></p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/372377612015-07-05T09:45:25Z2015-07-05T09:45:25ZHow can I output some debug data during an xunit test?<div><p>Hi Feodor - yep. confirmed. Problem was me reading code / error
messages late at night.</p>
<p>For anyone else reading this, if you wish to redirect
<code>Debug.WriteLine</code> .. etc to the <code>Console.Out</code>
.. you can use this (and this can also be re-written in a
<code>config</code> file, I believe)...</p>
<pre>
<code>TraceListener[] listeners = {
new TextWriterTraceListener(Console.Out)
};
Debug.Listeners.AddRange(listeners);</code>
</pre></div>Pure Krome