You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description
When trying to implement some server logging for a headless Pharo application I was having issues with not seeing the logged line before my error occured - Transcript show: 'msg'; flush. didn't work - and looking at the code for #flush, it suggests to use #sync after a flush to ensure the buffer is written out. When I tried to use ...flush; sync. I get a primitiveFailed error in an Ubuntu docker image.
Create a HelloWorld class in Pharo that logs some output to the transcript and create a method #flushSync on NonInteractiveTranscript, that does "self critical: [ (self stream) flush; sync ], then log some output like Transcript cr; show: 'Hello'; flushSync.
Run the pharo image in headless mode and call your HelloWorld class (to get output to stdio)
You will get a walkback error
Expected behavior
You shouldn't get a primitive failed error.
Note - it turns out that to get reliable log output it seems that the magic trick is to do : Transcript show: 'xxx'; cr; flush.
I also wonder if the comment for flush/sync should be updated, as I'm not sure its correct.
Screenshots
Version information:
OS: [e.g. iOS] Alpine Linux v3
Version: [e.g. 1.6.1]
Pharo Version [e.g 9] 11
Expected development cost
As you know nothing happens magically, so do you have an idea of the development effort required?
In addition, are you willing to help because after all Pharo is yours too?
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Bug description
When trying to implement some server logging for a headless Pharo application I was having issues with not seeing the logged line before my error occured - Transcript show: 'msg'; flush. didn't work - and looking at the code for #flush, it suggests to use #sync after a flush to ensure the buffer is written out. When I tried to use ...flush; sync. I get a primitiveFailed error in an Ubuntu docker image.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
You shouldn't get a primitive failed error.
Note - it turns out that to get reliable log output it seems that the magic trick is to do : Transcript show: 'xxx'; cr; flush.
I also wonder if the comment for flush/sync should be updated, as I'm not sure its correct.
Screenshots
Version information:
Expected development cost
As you know nothing happens magically, so do you have an idea of the development effort required?
In addition, are you willing to help because after all Pharo is yours too?
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: