[squeak-dev] squeak logging package(s)
Trygve Reenskaug
trygver at ifi.uio.no
Fri Jul 10 09:43:28 UTC 2020
I once did a VW program that logged the messages received by the
instances of a class. It was easy to code; the challenge was filtering.
I abandoned the program because its long logs didn't tell me anything
new. (Logging even a few seconds of /all /messages is prohibitive, there
are too many of them).
My principle was simple. AFAICR, the code went something like this:
1. All messages handled by a class pass through its /methodDict/. Make
a copy of this dict, say /methodDictCopy/
2. Automatically create a new set of methods for the original
/methodDict /according to their number of arguments:
aClass>>perform: aSymbol
/or /aClass>>perform: aSymbol with: firstObject etc.
In this method,
Log message to a file, if wanted.
Look up the requested method in /methodDictCopy.
/Execute it.
As I said above, the scheme worked, but it was never used in practice
because I didn't find it useful. Its weakness is that it only logs
messages received by instances of one class. An advantage is that it
does not require any changes to the VM. What's needed is a log of the
messages flowing between selected instances of many classes. The above
scheme could be extended to do that, but I thought the description
belonged to the design stage. May be it could be a reverse engineering tool?
I used the OORAM role modeling tool to move the description of the
message flows from the execution to the design stage. This tool helped
the programmer design the answer to three questions: What are the
objects? How are they interconnected? What do they do? With these three
answers, the implementation with classes was straight-forward.
I later moved the description from the design stage to the coding stage
with the /DCI programming paradigm/.
Today, I code the flow of messages explicitly. I have also extended the
Squeak universe of objects with all objects available through an IoT.
Alan's object orientation is now literally realized in practice: “/…its
semantics are a bit like having thousands and thousands of computers all
hooked together by a very fast network./” But that is another story.
TRee
On 2020-07-10 02:13, tim Rowledge wrote:
> I'm looking for some good message logging stuff - something a little more flexible that `Transcript show:` level - and so far the best I can see is a rather old package on squeaksource named 'Logging' originally by Keith Hodges but with quite a few updates by Mat Fulmer.
>
> I wonder if anyone is using it in a current image? It seems to rely on some process specific variable code that *looks* like has been incorporated into the trunk. I don't want to spend too much time peering at it is somebody else already knows whether it is unusable now or better yet still 'load and go'
>
> Or indeed, it somebody has a pointer to sometihng newer/better/shinier?
>
> tim
> --
> tim Rowledge;tim at rowledge.org;http://www.rowledge.org/tim
> Ubi dubium ibi libertas
>
>
--
/The essence of object orientation is that objects collaborateto achieve
a goal. /
Trygve Reenskaug mailto: trygver at ifi.uio.no <mailto:%20trygver at ifi.uio.no>
Morgedalsvn. 5A http://folk.uio.no/trygver/
N-0378 Oslo http://fullOO.info
Norway Tel: (+47) 468 58 625
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200710/ef54f278/attachment.html>
More information about the Squeak-dev
mailing list
|