[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sup-talk] Hints on debugging hooks
> Can someone give me some hints on debugging hooks? For example, is there an easy way to get just one message object in the console, so I can play with it?
For hooks, I tried using debug. So in the before-add-message hook you
could have:
debug ("message subject is #{message.subj} and is from #{message.from.email}")
Then launch sup with debug on:
$ SUP_LOG_LEVEL=debug sup
And you will get extra logging, including your hook debug message, in
the log buffer (press ; to see the buffer list).
One thing to watch out for in the message hooks is that the regex is
case sensitive by default. To change that, just put an i at the end,
eg
if message.subj =~ /\[sup-talk\]/i
message.add_label "sup"
end
Good luck
Hamish
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk