Allow to seek in time by position in any OutputStream created by the code

Can you add the same function as "Recorded Console" to any kind of OutputStream?

Background: I'm writing code generators and the ability to seek to the piece of code which wrote some output to a file would be invaluable.

I don't think Post Execution Logging would fit my use case because there is no counter or offset "variable" in the standard OutputStream interface.
1 person likes
this idea
+1
Reply
  • hmm interesting....

    I think a better and more generic way to implement this inside Chronon would be to allow listing arguments to a particular method call, on a particular object.

    In your case, you would:

    1. select the outputstream object you want to track
    2. select the methods whose arguments you want to list ( write() in your case)
    3. once selected, you would see exactly what was passed to write() everywhere in your code, and clicking on a line of output would take you to the correct point in time


    Critics, improvements and all suggestions on this are welcome :)
    • view 2 more comments
    • This sounds not at all what I want.

      What I want is to click in the text editor and get to the point in time when the selected output was written.
    • What I would like is Chronon to wrap the OutputStream API somehow so that I can get a view on the whole output as a text stream (i.e. as if the OutputStream had written the data into the view).

      Then I can search this view for the output that I'm interested in. When I have found something, I click and Chronon should show the stack trace at the time when this output was written.

      So internally, you probably need to collect all the calls to write() and count bytes. But from the UI, it should look as if Chronon would just display the content of a file.

      The reason why I ask for a support for this is that it's pretty hard to locate the OutputStream when you have a file name. For Chronon, it would be easy to find the file object, then the FileOutputStream and from that, it would know which OutputStream was used to write to the file (or rather which streams since output streams are usually wrapped in Java).
  • (some HTML allowed)
    How does this make you feel? Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited sad, anxious, confused, frustrated indifferent, undecided, unconcerned