Streaming problem in case of errors
P Hi guys, when PharoDebug.log can't be created (e.g., when the image is in a non writeable directory like /usr/share), the errors are sent to the Transcript in the hope that they will be redirected to stdout or stderr. However, ContextPart>>errorReportOn: is called when an exception is signaled and this method assumes that the stream is positionable (which is not the case for transscript, stdin and stderr). I was planing on rewriting ContextPart>>errorReportOn: to make it independent of #position. What do you think? -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
On 28 Feb 2014, at 14:12, Damien Cassou <damien.cassou@gmail.com> wrote:
P Hi guys,
when PharoDebug.log can't be created (e.g., when the image is in a non writeable directory like /usr/share), the errors are sent to the Transcript in the hope that they will be redirected to stdout or stderr. However, ContextPart>>errorReportOn: is called when an exception is signaled and this method assumes that the stream is positionable (which is not the case for transscript, stdin and stderr). I was planing on rewriting ContextPart>>errorReportOn: to make it independent of #position. What do you think?
Please do, I can't imagine why it needs to do positioning just to write output, you know that I think the stream API is way to wide...
On Fri, Feb 28, 2014 at 2:20 PM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
Please do, I can't imagine why it needs to do positioning just to write output, you know that I think the stream API is way to wide...
this is used to count the number of written characters. As soon as 150000 characters are wrote, the method writes '...etc...' and then stops writing. I would have to change that by writing to a String-based stream and counting there before writing to Transcript. However, this is going to take memory space which might not exist as an out of memory could be the cause of this method to be executed. -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
You could consider wrapping the actual output stream with a version that counts its output before delegating (ZnBufferedWriteStream does something like that). It might involve some experimentation to get the API right. There is also LimitedWriteStream that might help. On 28 Feb 2014, at 14:36, Damien Cassou <damien.cassou@gmail.com> wrote:
On Fri, Feb 28, 2014 at 2:20 PM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
Please do, I can't imagine why it needs to do positioning just to write output, you know that I think the stream API is way to wide...
this is used to count the number of written characters. As soon as 150000 characters are wrote, the method writes '...etc...' and then stops writing.
I would have to change that by writing to a String-based stream and counting there before writing to Transcript. However, this is going to take memory space which might not exist as an out of memory could be the cause of this method to be executed.
-- Damien Cassou http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
Camillo has another suggestion: https://pharo.fogbugz.com/f/cases/13008 On Fri, Feb 28, 2014 at 2:48 PM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
You could consider wrapping the actual output stream with a version that counts its output before delegating (ZnBufferedWriteStream does something like that). It might involve some experimentation to get the API right.
There is also LimitedWriteStream that might help.
On 28 Feb 2014, at 14:36, Damien Cassou <damien.cassou@gmail.com> wrote:
On Fri, Feb 28, 2014 at 2:20 PM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
Please do, I can't imagine why it needs to do positioning just to write output, you know that I think the stream API is way to wide...
this is used to count the number of written characters. As soon as 150000 characters are wrote, the method writes '...etc...' and then stops writing.
I would have to change that by writing to a String-based stream and counting there before writing to Transcript. However, this is going to take memory space which might not exist as an out of memory could be the cause of this method to be executed.
-- Damien Cassou http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
-- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
On Fri, Feb 28, 2014 at 3:59 PM, Damien Cassou <damien.cassou@gmail.com>wrote:
Camillo has another suggestion: https://pharo.fogbugz.com/f/cases/13008
could you please review https://pharo.fogbugz.com/f/cases/13008 -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
participants (2)
-
Damien Cassou -
Sven Van Caekenberghe