473,322 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

riddled with console messages

hi all,
i have a console app that takes care of a process that involves several
steps. And at each of those steps i report to the console that status of the
process. So I have all these System.Console statements thru out all my
classes.

Is there a better way to manage these messages? better design pattern?

thanks,
rodchar
Oct 22 '08 #1
3 1009
Do you NEED them to go to the console, or are they there fore debugging? If
you are using them for debugging use

System.Diagnostics.Debug.WriteLine instead, and look in the Output window in
VS.


--
Pete
====
http://mrpmorris.blogspot.com
http://www.capableobjects.com

Oct 22 '08 #2
On Wed, 22 Oct 2008 07:18:10 -0700, rodchar
<ro*****@discussions.microsoft.comwrote:
hi all,
i have a console app that takes care of a process that involves several
steps. And at each of those steps i report to the console that status of
the
process. So I have all these System.Console statements thru out all my
classes.

Is there a better way to manage these messages? better design pattern?
If you're trying to emit status messages, then you'll have to call
_something_ to do that. In many cases, Console.WriteLine() is as good as
anything.

That said, you might look into the TraceListener class and related.
That's similar to using the Diagnostics.Debug class Pete M. mentioned (in
fact, that's implemented as a provider for the default TraceListener).
Using TraceListener gives you more flexibility in terms of where the
output goes, in that you don't have to co-opt the standard output string
to change the output, and you can have multiple output destinations.

Pete
Oct 22 '08 #3
rodchar <ro*****@discussions.microsoft.comwrote:
i have a console app that takes care of a process that involves several
steps. And at each of those steps i report to the console that status of the
process. So I have all these System.Console statements thru out all my
classes.

Is there a better way to manage these messages? better design pattern?
Yup: use log4net.

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Oct 22 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Flip | last post by:
In j2ee/JBuilder/WebLogic when you do a System.err.println(), you can see the messages in the console that started the server. When I tried the same type of thing with VS 2k3 .NET and ASPX, I...
1
by: John Wright | last post by:
I am running a console application that connects to an Access database (8 million rows) and converts it to a text file and then cleans and compacts the database. When it runs I get the following...
2
by: nautonnier | last post by:
Hello, I have a C# app that spawns several processes each containing a console app written by another developer in C++. The console app was written first to be just like a console app: it...
4
by: Peter Nimmo | last post by:
Hi, I am writting a windows application that I want to be able to act as if it where a Console application in certain circumstances, such as error logging. Whilst I have nearly got it, it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.