Question on using Toothpick - the logging tool

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

Question on using Toothpick - the logging tool

squeakman
I using Toothpick (for the first time) to do my logging.  I am using the
FileLogger and what I want to do is to log all messages to a file.

What I observe is that only the last log message is written to the file
(in the Windows world). A bit of browsing the code reveals that the
stream pointer is not set to the end of the file.

I "fixed" the method FileLogger>>flush to be as follows:

1 flush
2 buffer position == 0 ifFalse: [
3 mutex critical: [
4 self stream setToEnd;
5 nextPutAll: buffer contents;
6 flush;
7 close.
8 buffer reset]]

with me adding the "setToEnd;" on line 4.

When I tested this change it does what I want and logs all messages to
the file.

My question: is this a proper fix or have I missed something?

Thanks,
Frank

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Question on using Toothpick - the logging tool

Philippe Marschall
2008/3/29, Squeaker <[hidden email]>:

> I using Toothpick (for the first time) to do my logging.  I am using the
> FileLogger and what I want to do is to log all messages to a file.
>
>  What I observe is that only the last log message is written to the file (in
> the Windows world). A bit of browsing the code reveals that the stream
> pointer is not set to the end of the file.
>
>  I "fixed" the method FileLogger>>flush to be as follows:
>
>  1 flush
>  2       buffer position == 0 ifFalse: [
>  3               mutex critical: [
>  4                       self stream setToEnd;
>  5                               nextPutAll: buffer contents;
>  6                               flush;
>  7                               close.
>  8                       buffer reset]]
>
>  with me adding the "setToEnd;" on line 4.
>
>  When I tested this change it does what I want and logs all messages to the
> file.
>
>  My question: is this a proper fix or have I missed something?

You're not the first with this problem and unfortunately this is not
the only problem the Squeak port of Toothpick has (one of the reasons
why we don't use it for Seaside). At least on squeak-dev people never
seemed to get a response. Maybe you're more lucky on this list or if
you try to contact the author directly  [1]  [2].

 [1] http://www.metaprog.com/Toothpick/
 [2] http://www.squeaksource.com/Toothpick.html


Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Question on using Toothpick - the logging tool

Göran Krampe
Hi!

How about trying SimpleLog? It even does log file rotation and has a
Morphic UI, and does syslog via UDP which means igt works fine even with a
load balanced set of seaside images. :)

regards, Göran

> 2008/3/29, Squeaker <[hidden email]>:
>> I using Toothpick (for the first time) to do my logging.  I am using the
>> FileLogger and what I want to do is to log all messages to a file.


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Question on using Toothpick - the logging tool

stephane ducasse
In reply to this post by squeakman
hi guys

may be contact joseph. I'm forwarding his email when I mentioned the  
problem to him.
I do not know who ported toothpick to squeak but contact joseph he is  
cool.
[hidden email]

Stef


Hi Stef,

Thanks for sending me this. I'll look at the code later this weekend.  
FYI - I don't know anything about the Squeak port of toothpick and  
its' problems. I've NEVER been contacted by anyone about it. This is  
the first mail I've ever seen.


On Mar 29, 2008, at 3:07 AM, Squeaker wrote:

> I using Toothpick (for the first time) to do my logging.  I am using  
> the FileLogger and what I want to do is to log all messages to a file.
>
> What I observe is that only the last log message is written to the  
> file (in the Windows world). A bit of browsing the code reveals that  
> the stream pointer is not set to the end of the file.
>
> I "fixed" the method FileLogger>>flush to be as follows:
>
> 1 flush
> 2 buffer position == 0 ifFalse: [
> 3 mutex critical: [
> 4 self stream setToEnd;
> 5 nextPutAll: buffer contents;
> 6 flush;
> 7 close.
> 8 buffer reset]]
>
> with me adding the "setToEnd;" on line 4.
>
> When I tested this change it does what I want and logs all messages  
> to the file.
>
> My question: is this a proper fix or have I missed something?
>
> Thanks,
> Frank
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Question on using Toothpick - the logging tool

keith1y
stephane ducasse wrote:

> hi guys
>
> may be contact joseph. I'm forwarding his email when I mentioned the
> problem to him.
> I do not know who ported toothpick to squeak but contact joseph he is
> cool.
> [hidden email]
>
> Stef
>
>
> Hi Stef,
>
> Thanks for sending me this. I'll look at the code later this weekend.
> FYI - I don't know anything about the Squeak port of toothpick and
> its' problems. I've NEVER been contacted by anyone about it. This is
> the first mail I've ever seen.
>
>
> On Mar 29, 2008, at 3:07 AM, Squeaker wrote:
>
>> I using Toothpick (for the first time) to do my logging.  I am using
>> the FileLogger and what I want to do is to log all messages to a file.
>>
>> What I observe is that only the last log message is written to the
>> file (in the Windows world). A bit of browsing the code reveals that
>> the stream pointer is not set to the end of the file.
>>
These problems have been mentioned occasionally in passing. I wrote
Logger as a logging framework independent layer to provide the greatest
choice. Logger, supports Toothpick and SimpleLog at the present time.

Keith


see Squeaksource.com/Logging

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside