[Pharo-project] Redirecting Transcript
There were several list threads about redirecting the Transcript e.g. to stdout... Is this available now in Pharo? If so, how do I redirect it to stdout? Thanks. Sean -- View this message in context: http://forum.world.st/Redirecting-Transcript-tp4622373.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
The thread title should've been "Headless Output" (although that doesn't really capture it either bc OS X headless doesn't seem to work)... I'm starting to put all my projects into Jenkins and want more feedback in the console output. So, I also want to catch all the progress bar titles and send them to stdout. I experimented with catching them thusly: FileStream fileNamed: 'loadLog.log' do: [ :str | [ConfigurationOfAutotest project bleedingEdge load] on: ProgressNotification, ProgressInitiationException do: [ :e | str nextPutAll: e asString; cr. e pass ] ]. which was weird... it caught all the top-level messages, but not the sub ones (e.g. while doing 'Loading 1.0-baseline of ConfigurationOfAutotest' (which was logged by the above), the 'Loading Autotest-Core' subtask was not logged. I stepped through and debugged for a while, but couldn't see the problem... Sean -- View this message in context: http://forum.world.st/Redirecting-Transcript-tp4622373p4622408.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
On 10 May 2012, at 04:47, Sean P. DeNigris wrote:
There were several list threads about redirecting the Transcript e.g. to stdout... Is this available now in Pharo? If so, how do I redirect it to stdout?
Have a look at NonInteractiveTranscript. ---- I am NonInteractiveTranscript, a replacement for Transcript, writing everything to a file or stdout. This is useful when running headless. NonInteractiveTranscript file install. To connect to the output stream of the virtual machine process choose stdout. NonInteractiveTranscript stdout install. An example, using various methods. | transcript | transcript := NonInteractiveTranscript new. transcript cr; << 'This is a test'; space; print: #(1 2 3). transcript cr; nextPut: $|; tab; nextPut: $#; nextPutAll: '-1-'; space; print: Float pi. Collection subclassesDo: [ :each | transcript cr; print: each ]. transcript crShow: 'Done!'. transcript close. --- There is more in Pharo than you think ;-) Sven -- Sven Van Caekenberghe http://stfx.eu Smalltalk is the Red Pill
On Thu, May 10, 2012 at 9:27 AM, Sven Van Caekenberghe <sven@beta9.be>wrote:
On 10 May 2012, at 04:47, Sean P. DeNigris wrote:
There were several list threads about redirecting the Transcript e.g. to stdout... Is this available now in Pharo? If so, how do I redirect it to stdout?
Have a look at NonInteractiveTranscript.
----
I am NonInteractiveTranscript, a replacement for Transcript, writing everything to a file or stdout.
This is useful when running headless.
NonInteractiveTranscript file install.
To connect to the output stream of the virtual machine process choose stdout.
NonInteractiveTranscript stdout install.
An example, using various methods.
| transcript | transcript := NonInteractiveTranscript new. transcript cr; << 'This is a test'; space; print: #(1 2 3). transcript cr; nextPut: $|; tab; nextPut: $#; nextPutAll: '-1-'; space; print: Float pi. Collection subclassesDo: [ :each | transcript cr; print: each ]. transcript crShow: 'Done!'. transcript close.
---
There is more in Pharo than you think ;-)
And even more black magic. Since you can do: Smalltalk at #Transcript put: NonInteractiveTranscript hahahah
Sven
-- Sven Van Caekenberghe http://stfx.eu Smalltalk is the Red Pill
-- Mariano http://marianopeck.wordpress.com
participants (3)
-
Mariano Martinez Peck -
Sean P. DeNigris -
Sven Van Caekenberghe