Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!news.mathworks.com!tank.news.pipex.net!pipex!lade.news.pipex.net!pipex!mk2!
From: dpeachey@vmark.co.uk (Dan)
Subject: Re: Tracking messages.
Organization: VMark Software Ltd.
Date: Tue, 12 Mar 96 13:07:33 GMT
Message-ID: <1996Mar12.130733.5383@vmark.co.uk>
X-Newsreader: Forte Free Agent 1.0.82
References: <1.5.4b11.16.19960311232810.50ff6b9a@kmglmail.wipsys.soft.net>
Sender: @vmark.co.uk
Lines: 46

Robin S Karatra <robin@KMGLMAIL.WIPSYS.SOFT.NET> wrote:

>Hi everybody,

>Can you give me a solution to this:

>I need to track all the messages that were sent to an object
>during runtime. I am planning to use a database table to log
>this history information. But I am not able to find an easy way
>to do this.

>Thanks in advance!

>Robin
>Systems Engineer
>Wipro Systems
>Bangalore, INDIA.

Hi,

There's an article posted concerning a timer profiler in
ENFIN/ObjectStudio.  This explains the ENFIN way of doing what you
want.

In general --  in the system there is a way of setting a Block of code
that is executed everytime a message is sent.

In ENFIN this is  System setSendHookTo: #MyHook.
#MyHook is the key of an entry in the global SendHooks dictionary.

Now if you wanted to monitor a certain class or object your
BlockContext would look something like: 

[:reciever :message :args | reciever isKindOf: ObjectIWantToMonitor
ifTrue: [Do my logging].].

Hope this gives you some ideas.

Thanks

Dan.

Object Studio Support Analyst (VMark UK).

My opinions are my own.

