mirror of
https://github.com/reactos/reactosdbg.git
synced 2024-11-23 03:39:43 +00:00
- Setup the diagnostics on app load.
- You can now use the static Trace.WriteLine method anywhere within the app to start making use of the log. svn path=/trunk/tools/reactosdbg/; revision=1026
This commit is contained in:
parent
30f3891f5b
commit
4810e1fc08
@ -8,6 +8,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Reflection;
|
||||
using System.Diagnostics;
|
||||
using WeifenLuo.WinFormsUI.Docking;
|
||||
using AbstractPipe;
|
||||
using DebugProtocol;
|
||||
@ -44,6 +45,29 @@ namespace RosDBG
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// Setup the logger
|
||||
try
|
||||
{
|
||||
if (Convert.ToBoolean(Settings.AppLogging))
|
||||
{
|
||||
File.Delete(Settings.AppLogFile);
|
||||
FileStream traceLogFile = new FileStream(Settings.AppLogFile, FileMode.OpenOrCreate);
|
||||
Trace.Listeners.Add(new TextWriterTraceListener(traceLogFile));
|
||||
Trace.AutoFlush = true;
|
||||
}
|
||||
}
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
MessageBox.Show(String.Format("Logging: {0} does not exist.\n" +
|
||||
"Please use the settings dialog to correct this",
|
||||
Settings.AppLogFile));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(String.Format("Failed to setup logging. Unexpected error:\n {0}",
|
||||
ex.Message));
|
||||
}
|
||||
|
||||
mSymbolContext = new SymbolContext();
|
||||
|
||||
RegisterControl(m_RegView);
|
||||
|
@ -260,6 +260,8 @@ namespace RosDBG
|
||||
public static string Pipe { get { return mProperties.Pipe; } }
|
||||
public static string ComPort { get { return mProperties.Port; } }
|
||||
public static string Baudrate { get { return mProperties.Baudrate; } }
|
||||
public static string AppLogging { get { return mProperties.AppLogging; } }
|
||||
public static string AppLogFile { get { return mProperties.AppLogFile; } }
|
||||
public static Connect.ConnectionType SelectedConnType {
|
||||
get { return mProperties.SelectedConnType; }
|
||||
set { mProperties.SelectedConnType = value; }
|
||||
|
Loading…
Reference in New Issue
Block a user