squeak logging package(s)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

squeak logging package(s)

timrowledge
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; [hidden email]; http://www.rowledge.org/tim
Ubi dubium ibi libertas


Reply | Threaded
Open this post in threaded view
|

Re: squeak logging package(s)

Trygve
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; [hidden email]; http://www.rowledge.org/tim
Ubi dubium ibi libertas



--

The essence of object orientation is that objects collaborate  to achieve a goal.
Trygve Reenskaug      
[hidden email]
Morgedalsvn. 5A       
http://folk.uio.no/trygver/
N-0378 Oslo             
http://fullOO.info
Norway                     Tel: (+47) 468 58 625



Reply | Threaded
Open this post in threaded view
|

Re: squeak logging package(s)

Davide Grandi-3
In reply to this post by timrowledge
slicing a small slice of log4* ?
*doc => all classes : not too many classes.

"they" stole sUnit ... so we can slice log4*.

https://logging.apache.org/log4j/2.x/log4j-api/apidocs/index.html

(sorry, just my 0,02€)

Cheers,

     Davide

On 10/07/2020 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; [hidden email]; http://www.rowledge.org/tim
> Ubi dubium ibi libertas

--
Ing. Davide Grandi
email    : [hidden email]
mobile   : +39 339 7468 778
linkedin : http://linkedin.com/in/davidegrandi


Reply | Threaded
Open this post in threaded view
|

Re: squeak logging package(s)

Jakob Reschke
VA Smalltalk has log4s as a Smalltalk port of log4j. But I guess it is proprietary because you buy it with VA Smalltalk.


Davide Grandi <[hidden email]> schrieb am Fr., 10. Juli 2020, 12:57:
slicing a small slice of log4* ?
*doc => all classes : not too many classes.

"they" stole sUnit ... so we can slice log4*.

https://logging.apache.org/log4j/2.x/log4j-api/apidocs/index.html

(sorry, just my 0,02€)

Cheers,

     Davide

On 10/07/2020 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; [hidden email]; http://www.rowledge.org/tim
> Ubi dubium ibi libertas

--
Ing. Davide Grandi
email    : [hidden email]
mobile   : +39 339 7468 778
linkedin : http://linkedin.com/in/davidegrandi




Reply | Threaded
Open this post in threaded view
|

Re: squeak logging package(s)

Squeak - Dev mailing list

Hello,

I would take this opportunity to point out the TraceMonitor [1] package in Cryptography.

Installer ss project: "Cryptography'; install: 'TraceMonitor'.

The use is very straightforward as shown in the test case.

TraceMonitorTestCase>>#testTraceMonitor

| monitor |
monitor := TraceMonitor newNick: 'TestingMonitor'.
monitor monitor: self.
self etrace: #info msg: '1'.
self etrace: #warn msg: '1'.
self etrace: #debug msg: '1'.
self etrace: #error msg: '1'.

There is additional API, such as TraceMonitor>>#traceToTranscript. The default enabled domains are set in

TraceMonitor>>#initializeDefaultMonitors

self enableDomain: #info.
self enableDomain: #warning.
self enableDomain: #error.
self enableDomain: #debug.

You can always add new domains, such as #over_the_wire or #engine or #obj_references or what ever you need for your project. Then you can throw an event for that new domain with:

self etrace: #over_the_wire msg: 'msg received'.
self etrace: #engine msg: 'Engine state changed'.
self etrace: #
obj_references msg: 'new object registered'.

Another aspect is that the monitoring of internal objects can be granted by an previously registered object. So let us say you are monitoring the engine and it wants to extend monitoring to the object tables. First, you would #monitor: the engine:

| engine monitor |
monitor := TraceMonitor newNick: 'TestingMonitor'.
engine := SampleEngine new.
monitor monitor: engine.
engine init.

Then in SampleEngine>>#init we register the Object Tables, called the Scope.

SampleEngine>>#init
    objectTables
:= Scope new.
    self monitor: objectTables.

Thus, when inside a Scope method, calls #etrace:msg: the TraceMonitor will post it.

self etrace: #obj_references msg: 'new object registered'.

I hope this helps you to understand its uses. I hope you find it useful!

Kindly,
rabbit

[1] TraceMonitor - http://www.squeaksource.com/@fLap-whI8O1pUZtu/eNY6xSnW (this link may soon expire)

On 7/10/20 3:08 PM, Jakob Reschke wrote:
VA Smalltalk has log4s as a Smalltalk port of log4j. But I guess it is proprietary because you buy it with VA Smalltalk.


Davide Grandi <[hidden email]> schrieb am Fr., 10. Juli 2020, 12:57:
slicing a small slice of log4* ?
*doc => all classes : not too many classes.

"they" stole sUnit ... so we can slice log4*.

https://logging.apache.org/log4j/2.x/log4j-api/apidocs/index.html

(sorry, just my 0,02€)

Cheers,

     Davide

On 10/07/2020 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; [hidden email]; http://www.rowledge.org/tim
> Ubi dubium ibi libertas

--
Ing. Davide Grandi
email    : [hidden email]
mobile   : +39 339 7468 778
linkedin : http://linkedin.com/in/davidegrandi




Reply | Threaded
Open this post in threaded view
|

Re: squeak logging package(s)

timrowledge
In reply to this post by timrowledge


> On 2020-07-10, at 2:40 AM, Trygve Reenskaug <[hidden email]> wrote:
>
> I once did a VW program that logged the messages received by the instances of a class.

That's an interesting attack on a slightly different problem than mine; but I like the idea. If I needed to log the entire message flow I'd probably use a subclass of the simulator these days. A fast machine can simulate with bearable interactive performance, which is amazing.


> On 2020-07-10, at 12:44 PM, Robert Withers via Squeak-dev <[hidden email]> wrote:
>
> I would take this opportunity to point out the TraceMonitor [1] package in Cryptography.

That looks interesting, and since I am already loading the cryptography package it will be easy to just include. I'll see how it goes!

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful Latin Phrases:- Re vera, potas bene = Say, you sure are drinking a lot.



Reply | Threaded
Open this post in threaded view
|

Re: squeak logging package(s)

Paul DeBruicker
In reply to this post by timrowledge
Toothpick should load and work in 5.3

http://wiki.squeak.org/squeak/5890


Pharo has this announcements based one:
https://github.com/pharo-project/pharo-beacon 

With a blog post here:
http://www.humane-assessment.com/blog/beacon




timrowledge 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@

> ; http://www.rowledge.org/tim
> Ubi dubium ibi libertas





--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Reply | Threaded
Open this post in threaded view
|

Re: squeak logging package(s)

Davide Grandi-3
In reply to this post by Jakob Reschke

Thank-you,

I'm digging on ".instantiations.com", and there are cues on programmer's manual, slides & documentation.

Terms varying from "port" to "inspiration" to "log4s available as open source".


Bye & thank-you again,

    Davide

On 10/07/2020 21:08, Jakob Reschke wrote:
VA Smalltalk has log4s as a Smalltalk port of log4j. But I guess it is proprietary because you buy it with VA Smalltalk.

Davide Grandi <[hidden email]> schrieb am Fr., 10. Juli 2020, 12:57:
slicing a small slice of log4* ?
*doc => all classes : not too many classes.

"they" stole sUnit ... so we can slice log4*.

https://logging.apache.org/log4j/2.x/log4j-api/apidocs/index.html

(sorry, just my 0,02€)

Cheers,

     Davide

On 10/07/2020 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; [hidden email]; http://www.rowledge.org/tim
> Ubi dubium ibi libertas
--
Ing. Davide Grandi
email    : [hidden email]
-- 
Ing. Davide Grandi
email    : [hidden email]


Reply | Threaded
Open this post in threaded view
|

log4s : free on Pharo (Re: squeak logging package(s))

Davide Grandi-3
In reply to this post by Jakob Reschke

It appears on a Pharo catalog :
    https://catalog.pharo.org/catalog/project/Log4s
with a page on ... Gemstone !
   
http://ss3.gemstone.com/ss/Log4s.html/Wiki

bye,

    Davide
(smalltalk strikes back ...)

On 10/07/2020 21:08, Jakob Reschke wrote:
VA Smalltalk has log4s as a Smalltalk port of log4j. But I guess it is proprietary because you buy it with VA Smalltalk.


Davide Grandi <[hidden email]> schrieb am Fr., 10. Juli 2020, 12:57:
slicing a small slice of log4* ?
*doc => all classes : not too many classes.

"they" stole sUnit ... so we can slice log4*.

https://logging.apache.org/log4j/2.x/log4j-api/apidocs/index.html

(sorry, just my 0,02€)

Cheers,

     Davide

On 10/07/2020 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; [hidden email]; http://www.rowledge.org/tim
> Ubi dubium ibi libertas
-- 
Ing. Davide Grandi
email    : [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: squeak logging package(s)

Squeak - Dev mailing list
In reply to this post by timrowledge
Hi tim,

On 7/10/20 4:11 PM, tim Rowledge wrote:
> On 2020-07-10, at 12:44 PM, Robert Withers via Squeak-dev
> <[hidden email]> wrote:
>> I would take this opportunity to point out the TraceMonitor [1] package in Cryptography.
> That looks interesting, and since I am already loading the cryptography package it will be easy to just include. I'll see how it goes!

Super! I realized it wasn't where it should be, functionally. So I
published a new version 'TraceMonitor-rww.2.mcz'. I am now initializing
with a Transcript stream, but able to add multiple steams; Internally
the monitor writes to a CompositeStream, able to hold multiple streams.

Here we have a Transcript stream, by default, and a file stream.

     | monitor |
     monitor := TraceMonitor newNick: 'TestingMonitor'.
     monitor openTraceStreamNamed: 'traceMonitor.log'.

Calling #etrace:msg: in an object who is being monitored by this
monitor, will result in the event written to both the Transcript and the
file named 'traceMonitor.log'.

Unfortunately, I am not making any assertions in the TestCase, which is
more of an ExampleCase. If you will define your own domains, a test
example of etraceing with that domain could be built and output
verified, visually or assertively.

K, r



Reply | Threaded
Open this post in threaded view
|

Re: squeak logging package(s)

Trygve
In reply to this post by timrowledge
Thank you for reminding me about the simulator. It sounds like a perfect foundation for dynamic reverse engineering, but it will take a lot of thought and work to make it into a usable tool.

On 2020-07-10 22:11, tim Rowledge wrote:

On 2020-07-10, at 2:40 AM, Trygve Reenskaug [hidden email] wrote:

I once did a VW program that logged the messages received by the instances of a class.
That's an interesting attack on a slightly different problem than mine; but I like the idea. If I needed to log the entire message flow I'd probably use a subclass of the simulator these days. A fast machine can simulate with bearable interactive performance, which is amazing.


On 2020-07-10, at 12:44 PM, Robert Withers via Squeak-dev [hidden email] wrote:

I would take this opportunity to point out the TraceMonitor [1] package in Cryptography.
That looks interesting, and since I am already loading the cryptography package it will be easy to just include. I'll see how it goes!

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful Latin Phrases:- Re vera, potas bene = Say, you sure are drinking a lot.




--

The essence of object orientation is that objects collaborate  to achieve a goal.
Trygve Reenskaug      
[hidden email]
Morgedalsvn. 5A       
http://folk.uio.no/trygver/
N-0378 Oslo             
http://fullOO.info
Norway                     Tel: (+47) 468 58 625



Reply | Threaded
Open this post in threaded view
|

Re: squeak logging package(s)

timrowledge
In reply to this post by Paul DeBruicker
After too many distractions, back to thinking a bit about this;



> On 2020-07-10, at 3:04 PM, Paul DeBruicker <[hidden email]> wrote:
>
> Toothpick should load and work in 5.3

Very nearly; some assumptions about DateAndTime that are no longer valid meant having to fix a few methods. I have a changeset or mcz to offer to solve that. All the tests now pass, though I was under the impression the ISO8601 time stamps were meant to include the timezone.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful random insult:- Put a lens in each ear and you've got a telescope.



Reply | Threaded
Open this post in threaded view
|

Re: squeak logging package(s)

timrowledge
>
>
>> On 2020-07-10, at 3:04 PM, Paul DeBruicker <[hidden email]> wrote:
>>
>> Toothpick should load and work in 5.3

Oh, worth mentioning that the URL pointed to for more info (like doc?) is a 404 today.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
A conclusion is the place where you got tired of thinking.



Reply | Threaded
Open this post in threaded view
|

Re: squeak logging package(s)

Paul DeBruicker
Yeah its a goner.  I don't know of a copy anywhere.  


timrowledge wrote
>>
>>
>>> On 2020-07-10, at 3:04 PM, Paul DeBruicker &lt;

> pdebruic@

> &gt; wrote:
>>>
>>> Toothpick should load and work in 5.3
>
> Oh, worth mentioning that the URL pointed to for more info (like doc?) is
> a 404 today.
>
> tim
> --
> tim Rowledge;

> tim@

> ; http://www.rowledge.org/tim
> A conclusion is the place where you got tired of thinking.





--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Reply | Threaded
Open this post in threaded view
|

Re: squeak logging package(s)

timrowledge


> On 2020-07-17, at 3:51 PM, Paul DeBruicker <[hidden email]> wrote:
>
> Yeah its a goner.  I don't know of a copy anywhere.  

Yay for the Wayback machine! Looks like they kept enough to build some doc pages on the squeaksource wiki.


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful random insult:- Lightbulb over his head is burned out.



Reply | Threaded
Open this post in threaded view
|

Re: squeak logging package(s)

timrowledge


> On 2020-07-17, at 7:27 PM, tim Rowledge <[hidden email]> wrote:
>
>
>
>> On 2020-07-17, at 3:51 PM, Paul DeBruicker <[hidden email]> wrote:
>>
>> Yeah its a goner.  I don't know of a copy anywhere.  
>
> Yay for the Wayback machine! Looks like they kept enough to build some doc pages on the squeaksource wiki.

Hmm, that old doc implies the existence of socket, Windwos event, and 'user' logger classes. I wonder if anyone has ever kept a copy of those?


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
I'm so skeptical that I'm not sure I'm really a skeptic



Reply | Threaded
Open this post in threaded view
|

Re: squeak logging package(s)

timrowledge


> On 2020-07-17, at 7:36 PM, tim Rowledge <[hidden email]> wrote:
>
>>

>>> On 2020-07-17, at 3:51 PM, Paul DeBruicker <[hidden email]> wrote:
>>>
>>> Yeah its a goner.  I don't know of a copy anywhere.  
>>
>> Yay for the Wayback machine! Looks like they kept enough to build some doc pages on the squeaksource wiki.
>
> Hmm, that old doc implies the existence of socket, Windwos event, and 'user' logger classes. I wonder if anyone has ever kept a copy of those?

I've 'rescued' the available cod from the Wayback Machine and added it to the wiki pages attached to the squeaksource listing. I also noticed a possibly functional bit of code for syslog logging within Toothpick, which I will attempt to test sometime.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful random insult:- Life by Norman Rockwell, but screenplay by Stephen King.



Reply | Threaded
Open this post in threaded view
|

Re: squeak logging package(s)

timrowledge


> On 2020-07-18, at 3:13 PM, tim Rowledge <[hidden email]> wrote:
>
>
>
>> On 2020-07-17, at 7:36 PM, tim Rowledge <[hidden email]> wrote:
>>
>>>
>
>>>> On 2020-07-17, at 3:51 PM, Paul DeBruicker <[hidden email]> wrote:
>>>>
>>>> Yeah its a goner.  I don't know of a copy anywhere.  
>>>
>>> Yay for the Wayback machine! Looks like they kept enough to build some doc pages on the squeaksource wiki.
>>
>> Hmm, that old doc implies the existence of socket, Windwos event, and 'user' logger classes. I wonder if anyone has ever kept a copy of those?
>
> I've 'rescued' the available cod

... so please feel free to chip in ....
OK, possibly a bit Brit-specific.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful Latin Phrases:- Noli me vocare, ego te vocabo = Don't call me, I'll call you.



Reply | Threaded
Open this post in threaded view
|

Re: squeak logging package(s)

timrowledge
Well, a bit of confusion seems to have set in here wrt loafin Toothpick.

The Squeakmap entry loads the oldest version, Toothpick-tbn.1
There are a number of much newer versions and that includes a ConfigurationOf... so I tried

Installer squeaksource
    project: 'Toothpick';
    install: 'ConfigurationOfToothpick'.
(Smalltalk at: #ConfigurationOfToothpick) load

Which worked to load the newer code. It still required the small DateAndTime related patches to pass most of the SUnits, and now three TimestampFormatTestCase test fail for reasons I haven't looked at yet.

I'm currently a touch puzzled about how to load extra bits like the syslog code (clearly one could do Installer ss project: 'Toothpick'; load:... etc but that seems like bypassing what surely ought to be part of the ConfiguratonOf... stuff?) and also where I might contribute the DateAndTime patches without breaking anything. Does Pharo have different structure for DateAndTime, for example?

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful Latin Phrases:- Sic faciunt omnes. = Everyone is doing it.