[squeak-dev] Logging progress during an update
Chris Muller
asqueaker at gmail.com
Tue Sep 17 01:47:16 UTC 2013
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 <frank.shearar at gmail.com> 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
>
More information about the Squeak-dev
mailing list
|