• 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
log command problem?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

log command problem?


  • Subject: log command problem?
  • From: Dave <email@hidden>
  • Date: Thu, 6 Jan 2011 23:22:20 -0600

FYI,

I'm working on a large project. Several times now I've found after adding new code with associated log commands to debug it the application starts getting messages like this to syslog:

 *** -[AScriptName someMethod:parm2:parm3:]: unrecognized selector sent to object <AScriptName @0x200545b00: OSAID(514)>

The selector is aways a valid one for a handler in the same script and which was working fine before the bug starts happening. And the selector is either the same one for the function that is executing or another handler in the same script which isn't even called by the handler getting the exception.

This type of error is repeatable, and the method listed will be the same. But after a code change a different selector for a handler in the same script may start repeatedly showing up.

Most of my handlers have a try block surrounding the handler code. Each time the problem log message appears the 'on error' correctly runs. My 'on error' handlers include the errorMsg parameter which is always the same selector error message that was just logged.

The unrecognized selector problem will mysteriously go away once I spend considerable time adding log statements and rearranging code to try and track what is going on. And once fixed, if I revert back to any of the past failed attempts the bug reappears and reporting the same method selector as was reported before.

I've only tried disabling garbage collection for two of the times the problem came up, but both times the problem went away until I reenabled GC.
   current application's NSGarbageCollector's defaultCollector()'s disable()

Finally I'm starting to see another pattern, besides stopping GC, that seems to bypass this problem - the elimination of the & operator with string operands from the log command. Here's the latest example where I bypassed this problem:

_____ Original Code
set startHour to startComponent's hour() as integer
set endHour to endComponent's hour() as integer
log "GMT startHour " & startHour & ", endHour " & endHour

_____ Code That Works
set startHour to startComponent's hour() as integer
set endHour to endComponent's hour() as integer
log "GMT startHour"
log startHour
log ", endHour"
log endHour

-- Dave

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: log command problem?
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: missing value does not get passed in lists and records
  • Next by Date: Re: log command problem?
  • Previous by thread: Re: missing value does not get passed in lists and records
  • Next by thread: Re: log command problem?
  • Index(es):
    • Date
    • Thread