Skip to content

Instantly share code, notes, and snippets.

@shurane
Created April 25, 2017 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shurane/20fd8151087535fbd6a56f2af926163f to your computer and use it in GitHub Desktop.
Save shurane/20fd8151087535fbd6a56f2af926163f to your computer and use it in GitHub Desktop.
Logging.csproj
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<trace autoflush="false" indentsize="4">
<listeners>
<remove name="Default" />
<add name="consoleListener" type="System.Diagnostics.ConsoleTraceListener"/>
</listeners>
</trace>
</system.diagnostics>
</configuration>
using System;
using System.Diagnostics;
namespace Logging
{
public class Logging
{
public static void Main(String[] args)
{
Console.WriteLine("Hello World");
// http://stackoverflow.com/a/1614253/198348
//Trace.Listeners.Add(new ConsoleTraceListener());
Trace.WriteLine("Tracing that output");
Console.ReadLine();
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net46</TargetFramework>
</PropertyGroup>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment