[Pharo-dev] Logging API discussion

Tudor Girba tudor at tudorgirba.com
Thu Apr 28 05:07:45 EDT 2016


Hi,

> On Apr 28, 2016, at 10:55 AM, Denis Kudriashov <dionisiydk at gmail.com> wrote:
> 
> 
> 2016-04-28 10:20 GMT+02:00 Nicolai Hess <nicolaihess at gmail.com>:
> What I am talking about is that I don't want create MySpecialLog for any MySpecialDomainObject which I want to log.
> 
> Traits?
> 
> Put you logging api in a Trait instead of Object and let your MySpecialDomainObject use this trait ?
> 
> Really? 
> Try remember usual workflow when we investigate some problems with code when we can't use debugger. We put kind of "Transcript show:" in multiple places to see state of our objects at concrete point of time. With object logging we will log our objects directly without converting to strings. Do you want to stop your "debugging workflow" every time you need to log objects which not support it? (to add special trait).

This is a totally different scenario than the one of logging for an unforeseen situation. For this purpose, in Beacon we have dedicated signals such as those that capture the stack or the context and we can imagine several more. It is more powerful than Transcript and requires no string. Furthermore, because we have the type signal, we can also easily have an inspector that shows the relevant information.

> But anyway with Trait you can't add timestamp to your domain object which is always required for logs (I think we all agree about timestamp). 

We can indeed agree on timestamp, but as Sven said, we might need flexibility on how to capture it (DateAndTime vs ZTimestamp).

Cheers,
Doru

--
www.tudorgirba.com
www.feenk.com

"What is more important: To be happy, or to make happy?"




More information about the Pharo-dev mailing list