Logging progress during an update

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

Logging progress during an update

Frank Shearar-3
In my continuing CI tribulations (which hopefully are now drawing to a
close) I have reached a point where I have a new problem: builds time
out on Travis CI (which runs 'rake test' on every commit to the GitHub
repository) because Travis thinks the build has hung, because of a
lack of timeous logging.

I thought I'd log progressive updates, like "loading
Monticello-foo.1234" or similar. I can't quite make sense of things
though. I thought perhaps I could just catch ProgressNotifications or
ProgressInitiationExceptions, but neither worked. Does the update
process throw progress-displaying exceptions that I can catch? Is
there another way of logging the notifications to stdout?

Thanks!

frank

Reply | Threaded
Open this post in threaded view
|

Re: Logging progress during an update

Chris Muller-3
I use MaCommandLineProcessor to do all of my batch logging.  Here's
it's main processing method which bridges the OS world with the
Smalltalk world (e.g., parsing command-line arguments and logging
output):

MaCommandLineProcess class>>#do: aBlock
     self ensureStartedUp.
     [ [ aBlock valueWithAllArguments: self args ]
          on: ProgressInitiationException
          do:
               [ : pie | "Don't want to log this notification."
               pie defaultAction ] ]
          on: Notification , Warning
          do:
               [ : noti | StandardFileStream stdout
                     nextPutAll: DateAndTime now asString ;
                     space ;
                     nextPutAll: noti description ;
                     cr.
               noti resume ]
          on: SyntaxErrorNotification
          do:
               [ : err | StandardFileStream stdout
                     nextPutAll: err errorCode ;
                     cr.
               self haltOrQuit ]
          on: Error
          do:
               [ : err | err printVerboseOn: StandardFileStream stderr.
               self haltOrQuit.
               err isResumable ifTrue: [ err resume ] ]

I've used MaCommandLineProcessor for years and I think it suits
Squeak's TSTTCPW philosophy which is why I've had an itch to try
renaming and polishing it for the trunk.  But I don't know how it
would be received, so I haven't done the work.

HTH.

On Mon, Sep 16, 2013 at 4:59 PM, Frank Shearar <[hidden email]> wrote:

> In my continuing CI tribulations (which hopefully are now drawing to a
> close) I have reached a point where I have a new problem: builds time
> out on Travis CI (which runs 'rake test' on every commit to the GitHub
> repository) because Travis thinks the build has hung, because of a
> lack of timeous logging.
>
> I thought I'd log progressive updates, like "loading
> Monticello-foo.1234" or similar. I can't quite make sense of things
> though. I thought perhaps I could just catch ProgressNotifications or
> ProgressInitiationExceptions, but neither worked. Does the update
> process throw progress-displaying exceptions that I can catch? Is
> there another way of logging the notifications to stdout?
>
> Thanks!
>
> frank
>

Reply | Threaded
Open this post in threaded view
|

Re: Logging progress during an update

Frank Shearar-3
I really do need to take the time to look at that guy... So I should, for the moment, just need to catch the PIEs to log? I tried that but maybe I did it wrong. I'll take another run at it. We definitely do need a command line processor in trunk, at any rate. Loads of the CI work is working around our lack thereof.

frank

On 17 Sep 2013, at 2:47, Chris Muller <[hidden email]> wrote:

> I use MaCommandLineProcessor to do all of my batch logging.  Here's
> it's main processing method which bridges the OS world with the
> Smalltalk world (e.g., parsing command-line arguments and logging
> output):
>
> MaCommandLineProcess class>>#do: aBlock
>     self ensureStartedUp.
>     [ [ aBlock valueWithAllArguments: self args ]
>          on: ProgressInitiationException
>          do:
>               [ : pie | "Don't want to log this notification."
>               pie defaultAction ] ]
>          on: Notification , Warning
>          do:
>               [ : noti | StandardFileStream stdout
>                     nextPutAll: DateAndTime now asString ;
>                     space ;
>                     nextPutAll: noti description ;
>                     cr.
>               noti resume ]
>          on: SyntaxErrorNotification
>          do:
>               [ : err | StandardFileStream stdout
>                     nextPutAll: err errorCode ;
>                     cr.
>               self haltOrQuit ]
>          on: Error
>          do:
>               [ : err | err printVerboseOn: StandardFileStream stderr.
>               self haltOrQuit.
>               err isResumable ifTrue: [ err resume ] ]
>
> I've used MaCommandLineProcessor for years and I think it suits
> Squeak's TSTTCPW philosophy which is why I've had an itch to try
> renaming and polishing it for the trunk.  But I don't know how it
> would be received, so I haven't done the work.
>
> HTH.
>
> On Mon, Sep 16, 2013 at 4:59 PM, Frank Shearar <[hidden email]> wrote:
>> In my continuing CI tribulations (which hopefully are now drawing to a
>> close) I have reached a point where I have a new problem: builds time
>> out on Travis CI (which runs 'rake test' on every commit to the GitHub
>> repository) because Travis thinks the build has hung, because of a
>> lack of timeous logging.
>>
>> I thought I'd log progressive updates, like "loading
>> Monticello-foo.1234" or similar. I can't quite make sense of things
>> though. I thought perhaps I could just catch ProgressNotifications or
>> ProgressInitiationExceptions, but neither worked. Does the update
>> process throw progress-displaying exceptions that I can catch? Is
>> there another way of logging the notifications to stdout?
>>
>> Thanks!
>>
>> frank
>>
>