From 4d4b484e20394cf26270b556ce88fa52194d274f Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 09:53:07 +0000 Subject: Utilisateur : Fcolin Date : 6/02/06 Heure : 17:12 Archivé dans $/CSharp/Ivy/IvyDaemon Commentaire: utilisation generale de traceDEbug et System.Diagnostics (vss 4) --- CSharp/Ivy/IvyDaemon/IvyDaemon.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'CSharp/Ivy') diff --git a/CSharp/Ivy/IvyDaemon/IvyDaemon.cs b/CSharp/Ivy/IvyDaemon/IvyDaemon.cs index c35376f..c489c98 100644 --- a/CSharp/Ivy/IvyDaemon/IvyDaemon.cs +++ b/CSharp/Ivy/IvyDaemon/IvyDaemon.cs @@ -11,6 +11,7 @@ namespace IvyDaemon using System.Net; using System.Net.Sockets; using System.Configuration; + using System.Diagnostics; using IvyBus; /// IvyDaemon: simple TCP to Ivy relay. /// @@ -138,7 +139,7 @@ namespace IvyDaemon } public void Run() { - //traceDebug("Subreader Thread started"); + traceDebug("Subreader Thread started"); String msg = null; try { @@ -152,18 +153,17 @@ namespace IvyDaemon } catch (IOException ioe) { - //traceDebug("Subreader exception ..."); - Console.Error.WriteLine( ioe.StackTrace ); + traceDebug("Subreader exception:" + ioe.Message); System.Environment.Exit(0); } - //traceDebug("Subreader Thread stopped"); + traceDebug("Subreader Thread stopped"); } + } - - private void traceDebug(System.String s) + [Conditional("DEBUG")] + private static void traceDebug(string s) { - if (debug) - System.Console.Out.WriteLine("-->IvyDaemon " + bus.AppName + "<-- " + s); + Trace.WriteLineIf(debug, "-->IvyDaemon<-- " + s); } } } \ No newline at end of file -- cgit v1.1