473,769 Members | 3,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

? 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 1038

"Steve" <ss*@sss.com> wrote in message
news:uP******** ******@TK2MSFTN GP12.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
3711
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 with XP, but i absolutely cannot get PHP to display any errors in my browser. it's driving me nuts. i was able to do it under 2000. i remember having to add a line or two of code to the top of each page for which i wanted to display errors. ...
1
2423
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 things but I never get the combination done.
1
1706
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 setting in the php.ini file, ;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR ; ; - Show all errors except for notices ; error_reporting = E_ALL
0
1171
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. Or with the ini_set('display_errors', 1) via script Refer: http://www.php.net/manual/en/ref.errorfunc.php http://www.php.net/ini_set
5
2052
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 elegant way of reporting line number besides putting this line everywhere I access db. I want to just write a function, which also globally knows about the current line number(?) and in case
102
7123
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 of its documentation, it is a impeccability. it has or possesses properties of:
0
2649
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 message. This will provide our users the ability to send the crash report to Microsoft, which in turn will allow us to get it. We did a search for Visual Studio help to see what that might turn up and came across the “ReportFault”...
5
692
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 has fatal errors. This is because the desired runtime action does not get executed." .... has me confused if this will really work. Sorry I'm rusty on this. "To set at runtime, use the error_reporting(). See also the
1
1378
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 programmer on-call. There are pros and cons of each, of course... I'm curious as to what others do for their error reporting. Mind you this is a 24/7 application, and if something happens I have to
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10035
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9851
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8863
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2811
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.