You basically only get one console window per console process on Windows.
In theory you could do this with native code, but I doubt anyone has and
exposed it in a node module. So, the simplest solution is to have multiple
processes. The easiest way to do this would be to effectively pipe your
logs through a file, assuming you have "tail" installed, or something like
it (there's probably one written in node in npm), you can do something like
this:
var logger1 = fs.createWriteStream('log1.txt');
var logger2 = fs.createWriteStream('log2.txt');
child_process.exec('start "Log 1" tail -f log1.txt');
child_process.exec('start "Log 2" tail -f log2.txt');
logger1.write('To the first!');
logger2.write('To the second!');
You can probably do something more complicated with actual pipes instead of
files, and have the sub-processes be something like "type" or "cat" which
exit automatically upon a broken pipe.
On Wednesday, October 15, 2014 6:51:42 AM UTC-7, Sergey Lapin wrote:
>
> Preferably on windows.
>
> I have several duplex streams which I want log in different places. I
> would very convinient to stream them to separate console windows,
> because I use tdd with live coding. Files are not suitable here.
>
>
>
> http://stackoverflow.com/questions/26348823/several-console-instanses-in-node-js
>
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/73483e4e-d2cb-4c6d-852f-94b11b557d65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.