Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: Error Logging

  1. #1
    Regular Coder
    Join Date
    May 2005
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error Logging

    Anyone done this extensively, any tips?
    Thanks in advance!

  • #2
    Regular Coder
    Join Date
    May 2005
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This question might be my first entry...
    Thanks in advance!

  • #3
    Regular Coder
    Join Date
    May 2005
    Location
    Michigan, USA
    Posts
    566
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Error Logging Via what? I do all sorts of error logging for my internal website. If there is an ASP/PHP error then i log that and also send me an email. If there is an XML parsing error via the XMLHTTP request object, i store it to the database then send myself an email. If there is a problem with a certain section of code I just put a "Try/Catch" around it and send myself the same notes. Then in the database I write down when I fixed it and how. I donít know exactly what you want though? And error logger in JS? I just an XMLHTTP request object to do that. And if it fails for god knows what reason (We are only allowed to use IE5.5+ and MF 1.x) I have the page create an IFRAME and sends the information that way. And if for some reason that Fails i display an annoying message to the user telling them to contact me right away. Which does not disappear until they refresh the page.

    But what exactly do you want / need. Most JS code should be written not to fail. You should be checking all your objects and variables as you go along. Have a function that should be accepting only strings?

    Code:
    function returnString( sStr ) { 
         if ( typeof sStr != 'string' ) return ''; 
         return sStr; 
    }
    You should be doing allot of checks inside your code to make sure there are minimal errors inside of it.

    Sorry that this turned into a rant. But I have co workers that are the same way. SpiritOfGrandeur how do you check for errors in your JS. Once I sit down and teach them how to write good JS, their need for error reports mostly goes away. And if it doesnít I just tell them to run my function to report it to themselves

  • #4
    Regular Coder
    Join Date
    May 2005
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Nope, nothing to do with debugging code. I would explain but doubt it will accomplish anything here...
    Thanks in advance!

  • #5
    Regular Coder
    Join Date
    May 2005
    Location
    Michigan, USA
    Posts
    566
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Again though you did not specify what exactly you wanted to log! What type of errors how are the errors happening?

  • #6
    Regular Coder
    Join Date
    May 2005
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What does it matter, being a general thing? The error is abstract. The question was open ended: I no longer care.
    Thanks in advance!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •