Writing notifications to stdout (was Re: [squeak-dev] Re: New release candidate: 4.4-12324)

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

Writing notifications to stdout (was Re: [squeak-dev] Re: New release candidate: 4.4-12324)

Frank Shearar-3
On 28 December 2012 17:48, David T. Lewis <[hidden email]> wrote:

> On Thu, Dec 27, 2012 at 11:34:32AM +0000, Frank Shearar wrote:
>> On 27 December 2012 11:00, H. Hirzel <[hidden email]> wrote:
>> > Frank,
>> >
>> > where can I have a look at the build script?
>> >
>> > And the console output is not very talkative....
>> >
>> > http://squeakci.org/job/ReleaseSqueakTrunk/17/console
>>
>> * https://github.com/frankshearar/squeak-ci/blob/download-vms/release.sh
>> * https://github.com/frankshearar/squeak-ci/blob/download-vms/release.st
>>
>> No, the scripts are not talkative at all. I'm really not sure how to
>> make them more talkative. Obviously in the shell scripts you can use
>> echo, but those do hardly anything. Really what I want is something
>> that writes to the Transcript when headful and to stdout/stderr when
>> headless. I don't think we have such a thing at the moment.
>
> Try something like this in your Smalltalk scripts:
>
>   "Define a block to take a single string parameter and write a message
>   to both the console stdout and to the Transcript"
>   log := [:msg | | str |
>         str := DateAndTime now printString, ': ', msg.
>         FileStream stdout nextPutAll: str; nextPut: Character lf; flush.
>         Transcript cr; show: str].
>
>   "Then sprinkle the rest of your script with things like this"
>   log value: 'Begin loading my package from SqueakSource'.
>
>   log value: 'My package is loaded now'.

I think what I'm after is something like Pharo's headless UIManager,
actually. The ReleaseSqueakTrunk build is hanging right now and
there's no indication why. If I run the build script locally I can
remove the -vm-display-null stuff and see the "Cleaning packages"
progress bar, and so on. If I could hook into _that_, things would
become a whole lot easier to debug. That, and having a script fail and
log to stdout instead of bringing up a Debugger.

I think I'll add that to the 4.5 wish list!

frank

> Dave
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Writing notifications to stdout (was Re: [squeak-dev] Re: New release candidate: 4.4-12324)

Colin Putney-3



On Wed, Jan 2, 2013 at 5:35 PM, Frank Shearar <[hidden email]> wrote:
I think what I'm after is something like Pharo's headless UIManager,
actually. The ReleaseSqueakTrunk build is hanging right now and
there's no indication why. If I run the build script locally I can
remove the -vm-display-null stuff and see the "Cleaning packages"
progress bar, and so on. If I could hook into _that_, things would
become a whole lot easier to debug. That, and having a script fail and
log to stdout instead of bringing up a Debugger.

I think I'll add that to the 4.5 wish list!

I've long wanted to push OmniBrowser's InteractionNotifications into the base. OB does all user interaction by raising a notification. The UI process catches the exception, does the interaction, and resumes with some kind of result. We do this in a few places, but it should be made comprehensive. 

This scheme has two beneficial effects:

- it's possible to intercept interaction requests programmatically for scripts or headless situations
- it decouples low-level code from the UI, which should help with modularization and shrinking

Colin