Click here to Skip to main content
15,899,026 members
Home / Discussions / C#
   

C#

 
GeneralRe: web service [modified] Pin
Wendelius18-Nov-08 6:24
mentorWendelius18-Nov-08 6:24 
GeneralRe: web service Pin
netJP12L18-Nov-08 7:26
netJP12L18-Nov-08 7:26 
Questionbinary trees and traverse Pin
nesfrank18-Nov-08 5:06
nesfrank18-Nov-08 5:06 
AnswerRe: binary trees and traverse Pin
Pedram Behroozi18-Nov-08 5:59
Pedram Behroozi18-Nov-08 5:59 
AnswerRe: binary trees and traverse Pin
Alan Balkany19-Nov-08 3:53
Alan Balkany19-Nov-08 3:53 
GeneralRe: binary trees and traverse Pin
nesfrank19-Nov-08 8:12
nesfrank19-Nov-08 8:12 
GeneralRe: binary trees and traverse Pin
Alan Balkany19-Nov-08 8:17
Alan Balkany19-Nov-08 8:17 
QuestionDebug Statements - writing to the console and files Pin
stormydaniels18-Nov-08 4:18
stormydaniels18-Nov-08 4:18 
Hi,

I'm writing an application in which I'm currently using Console.Writeline() calls to output the various stages. This helps me to develop and debug as I go. However, the time will come when I want to remove all such calls. Can anyone suggest some advice, an article (I have searched on CP) or other source which will tell me how to use debug statements in code which I can then switch off for release.

I was thinking of a logging class - in debug mode it would write to the console but in release mode it would write certain information to a file. The Console.Writeline() methods allows me to do the following:

Console.Writeline("Val1 {0}, Val2 {2}", val1, val2);

How could I write my own function which would accept an unknown number of parameters like this? I would like my function to pass the parameters directly to Console.Writeline() or to a file depending on a flag.

Thanks for any help offered Smile | :)
AnswerRe: Debug Statements - writing to the console and files Pin
DaveyM6918-Nov-08 4:27
professionalDaveyM6918-Nov-08 4:27 
GeneralRe: Debug Statements - writing to the console and files Pin
Ennis Ray Lynch, Jr.18-Nov-08 4:41
Ennis Ray Lynch, Jr.18-Nov-08 4:41 
AnswerRe: Debug Statements - writing to the console and files [modified] Pin
Paul Conrad18-Nov-08 4:54
professionalPaul Conrad18-Nov-08 4:54 
GeneralRe: Debug Statements - writing to the console and files Pin
Dave Kreskowiak18-Nov-08 8:10
mveDave Kreskowiak18-Nov-08 8:10 
GeneralRe: Debug Statements - writing to the console and files Pin
Paul Conrad18-Nov-08 8:39
professionalPaul Conrad18-Nov-08 8:39 
GeneralRe: Debug Statements - writing to the console and files Pin
stormydaniels18-Nov-08 5:24
stormydaniels18-Nov-08 5:24 
QuestionDirectory.GetLastWriteTime(fpath) overwrites the path string Pin
beriho18-Nov-08 4:05
beriho18-Nov-08 4:05 
AnswerRe: Directory.GetLastWriteTime(fpath) overwrites the path string Pin
Ennis Ray Lynch, Jr.18-Nov-08 4:09
Ennis Ray Lynch, Jr.18-Nov-08 4:09 
GeneralRe: Directory.GetLastWriteTime(fpath) overwrites the path string Pin
beriho18-Nov-08 4:13
beriho18-Nov-08 4:13 
AnswerRe: Directory.GetLastWriteTime(fpath) overwrites the path string Pin
Guffa18-Nov-08 4:12
Guffa18-Nov-08 4:12 
GeneralRe: Directory.GetLastWriteTime(fpath) overwrites the path string Pin
beriho18-Nov-08 5:03
beriho18-Nov-08 5:03 
QuestionLearning C# by example? Complete projects? Pin
Dougmeister18-Nov-08 3:04
Dougmeister18-Nov-08 3:04 
AnswerRe: Learning C# by example? Complete projects? Pin
Alan Balkany18-Nov-08 3:27
Alan Balkany18-Nov-08 3:27 
AnswerRe: Learning C# by example? Complete projects? Pin
#realJSOP18-Nov-08 3:44
professional#realJSOP18-Nov-08 3:44 
GeneralRe: Learning C# by example? Complete projects? Pin
Dougmeister18-Nov-08 3:51
Dougmeister18-Nov-08 3:51 
GeneralRe: Learning C# by example? Complete projects? Pin
stormydaniels18-Nov-08 4:11
stormydaniels18-Nov-08 4:11 
GeneralRe: Learning C# by example? Complete projects? [modified] Pin
Guffa18-Nov-08 4:19
Guffa18-Nov-08 4:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.