set Trace listeners manually on application startup.

This commit is contained in:
morkt 2014-08-01 16:38:29 +04:00
parent 5d8962138b
commit 5d3ba6903b
2 changed files with 6 additions and 8 deletions

View File

@ -5,13 +5,6 @@
<section name="GARbro.GUI.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/> <section name="GARbro.GUI.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup> </sectionGroup>
</configSections> </configSections>
<system.diagnostics>
<trace autoflush="true">
<listeners>
<add type="System.Diagnostics.TextWriterTraceListener" name="TextWriter" initializeData="trace.log"/>
</listeners>
</trace>
</system.diagnostics>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/>
</startup> </startup>

View File

@ -50,6 +50,11 @@ namespace GARbro.GUI
void ApplicationStartup (object sender, StartupEventArgs e) void ApplicationStartup (object sender, StartupEventArgs e)
{ {
#if DEBUG
string trace_dir = Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly().Location);
Trace.Listeners.Add (new TextWriterTraceListener (Path.Combine (trace_dir, "trace.log")));
Trace.AutoFlush = true;
#endif
Trace.WriteLine ("ApplicationStartup --------------------------------", "GARbro.GUI.App"); Trace.WriteLine ("ApplicationStartup --------------------------------", "GARbro.GUI.App");
if (0 != e.Args.Length) if (0 != e.Args.Length)
{ {