• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Non-fatal errors in frameworks - how should they be noted? (fwd)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Non-fatal errors in frameworks - how should they be noted? (fwd)


  • Subject: Non-fatal errors in frameworks - how should they be noted? (fwd)
  • From: email@hidden
  • Date: Wed, 28 May 2003 14:30:26 +0200

hoi!

well, what you want to do is redirect stderr. it seems that when u start an ap using open or double clicking stderr will go to the console. you will see that when u start the executable directly (i.e bash$./myapp.app/contents/MacOS/myapp) the NSLog stuff will go to your bash.

i think in bash you can redirect by something like adding $2>logfile or similar. if you dont want to go through the shell (you could also provide a double clickable script for this by adding .command to the end of the script filename) you have to somehow redirect stderr programmatically. my guess is that the obligate NSApplicationMain(...) somehow handles the redirection, and you just have to add the redirection code after that in the main(...). i think the c command reopen() is good for this...

daniel

quote>>>
What's the best way to make notice of a non-fatal error within a Foundation-based framework? At present I'm returning nil's where appropriate, and outputting via NSLog the reason for the failure. Is there a better way, other than NSLog, to allow developers to determine what's going wrong, without killing the program outright? I don't like using the standard console as my dumping ground for error messages, but otherwise it has all the features I like - displays in Project Builder's console when debugging, doesn't kill the app, doesn't require the returning of error conditions (bad form in Cocoa), doesn't require exception handling (many people, including myself, don't like to use exceptions), etc.

I'm contemplating writing my own general logging routine, to log to a different file. But then that's heading away from well-established convention, which I'd rather not do unless I have to.

Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
<<<qoute<<<
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Prev by Date: Non-fatal errors in frameworks - how should they be noted?
  • Next by Date: Newbie Question (alloc, init, retain?)
  • Previous by thread: Non-fatal errors in frameworks - how should they be noted?
  • Next by thread: Newbie Question (alloc, init, retain?)
  • Index(es):
    • Date
    • Thread