[erlang-patches] format_status analog for error_info

Steve Vinoski vinoski@REDACTED
Sun Feb 28 07:13:37 CET 2010


On Fri, Feb 26, 2010 at 2:30 AM, Steve Vinoski <vinoski@REDACTED> wrote:

>
>
> On Thu, Feb 25, 2010 at 11:31 AM, Andrew Thompson <andrew@REDACTED>wrote:
>
>> On Thu, Feb 25, 2010 at 05:16:38PM +0100, Bj??rn Gustavsson wrote:
>> > On Thu, Feb 25, 2010 at 4:56 PM, Andrew Thompson <andrew@REDACTED>
>> wrote:
>> > >
>> > > Hah! gen_event actually uses the result of terminate() to start the
>> new
>> > > handler - I'd forgotten that. That makes things a lot more
>> complicated.
>> >
>> > So perhaps it would be better to use Steve's approach?
>> >
>> > Other than that, I personally don't have any opinion yet on which
>> > approach is the better one.
>> >
>>
>> I'm inclined to agree - except that gen_event doesn't support the
>> callback module having a format_status callback, at least not yet.
>>
>> In theory sys:get_status on a gen_event could call Mod:format_status for
>> all its handlers with their respective states on their respective
>> modules.
>>
>
> Nice idea -- I've implemented this in the patch I'm working on, and it
> works just fine.
>

This patch is ready:

git fetch git://github.com/vinoski/otp.git format_status_error_info

Since gen_event did not previously have format_status callback support, I
made these changes in two commits: the first to add termination support to
existing format_status support in gen_fsm and gen_server along with doc and
unit tests, and the second commit to add the format_status callback support
to gen_event along with related doc and unit tests.

--steve


More information about the erlang-patches mailing list