473,385 Members | 1,427 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,385 software developers and data experts.

? about reporting errors

I have found myself being a bad programmer. I know I should trap errors and
exceptions and log them, but I'm not.... everywhere. I DO when the error
happens in my Form class because that is where I initially setup my error
log. I find now, after adding 30+ classes that when an error happens in
them, I don't do anything because I don't have easy access to the logging
functionality defined in my Form class.

I realize I've got a flawed design and that my error handling should be
abstracted from the Form class and stand on it's own. How do most of you
handle this? A LogClass with static methods(IE: LogError(), LogWarning(),
etc) or maybe a Singleton class or possibly even passing a LogClass
reference into the c'tor of every class(No!)

If you have any "really clean or slick" solutions, please share.. I'm
spinning my wheels a little at this point.

Thank you,
Steve
Nov 17 '05 #1
1 1023

"Steve" <ss*@sss.com> wrote in message
news:uP**************@TK2MSFTNGP12.phx.gbl...
I have found myself being a bad programmer. I know I should trap errors and exceptions and log them, but I'm not.... everywhere. I DO when the error
happens in my Form class because that is where I initially setup my error
log. I find now, after adding 30+ classes that when an error happens in
them, I don't do anything because I don't have easy access to the logging
functionality defined in my Form class.

I realize I've got a flawed design and that my error handling should be
abstracted from the Form class and stand on it's own. How do most of you
handle this? A LogClass with static methods(IE: LogError(), LogWarning(),
etc) or maybe a Singleton class or possibly even passing a LogClass
reference into the c'tor of every class(No!)

If you have any "really clean or slick" solutions, please share.. I'm
spinning my wheels a little at this point.

Thank you,
Steve


Delegates are great!
singleton with a delegate to the UI method

everything is great ;)

have a good weekend!
Nov 17 '05 #2

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

Similar topics

1
by: Adam Siler | last post by:
i recently upgraded from Windows 2000 to Windows XP and now i can't seem to get error reporting to work in PHP. i don't know if i've simply forgotten how to do it, or if there's a bug associated...
1
by: Oliver Spiesshofer | last post by:
Hi, I have set in my .htaccess file php_flag error_reporting 2047 to prevent error output to users. However, in some selected scripts I want to allow errors to be shown. I tried several...
1
by: D. Alvarado | last post by:
Hello, Ia m running PHP 4 on Fedora Linus Apache 1.27. Since I have a dev box, I would like warnings to appear in the event of undefined variables or constants. But although I specified this...
0
by: R. Rajesh Jeba Anbiah | last post by:
Q: Why I don't get any errors? A: You might have turned the "display errors" off. Turn it on: 1. By changing 'display_errors' to true in php.ini (May require Apache restart if it is mod_php) 2....
5
by: steve | last post by:
Hi, In my script (phpnuke), whenever there is access to database, there is this line of code: message_die(GENERAL_ERROR, ’some error msg’, ’’, __LINE__, __FILE__, $sql); Is there a more...
102
by: Xah Lee | last post by:
i had the pleasure to read the PHP's manual today. http://www.php.net/manual/en/ although Pretty Home Page is another criminal hack of the unix lineage, but if we are here to judge the quality...
0
by: Joshua V. | last post by:
We are trying to implement Windows Error Reporting from within our VB.Net application. Basically we want to replace the standard unhandled exception message we use with the Windows Error Reporting...
5
by: Paul Furman | last post by:
What is the proper way to turn off error reporting? I'm on a shared server so... "Note: Although display_errors may be set at runtime (with ini_set ()), it won't have any affect if the script...
1
by: Melissa Nava | last post by:
Have an online system. Currently the error reporting either does: A) logs to a file, B) databases errors or C) emails individual errors. Also have phone notifications for systematically calling the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.