I am trying to set up my netburner to serve up an HTML page that contains, among other things, the last ~500 lines of stdout. The idea is to kind of have a remotely accessible error log. I'm a little unsure of how this would be done. These are the ideas I've come up with:
1) Include a functioncall in the HTML that temporarily redirects stdout away from the default debug port and towards the socket provided by the functioncall. (This would actually get me the next 500 lines, not the last 500, but the distinction isn't a huge difference as I am mostly just looking to get a snapshot of what the netburner is doing).
2) Permanently redirect stdout to a buffer in memory. FWIW I am more experienced at Java than C++ so this may actually be a dumb idea, but what I would do in Java is make an output stream out of this buffer and then just read out of it as an input stream when building the HTML page.
My questions are the following:
-How does one redirect stdout to anything? (I found this: http://www.netburner.com/support/techni ... stdout.htm but it seems to only tell you how to redirect it to a serial port... isn't that already the default functionality?)
-If I were to do option #2, is that output/input stream stuff something you can actually do in C++, or would I have to order stuff in the buffer the hard way?