The next best thing was to send my output to another process, a console-by-proxy.īack in the 90s I had done interprocess communication using Windows’ named pipes feature. But old habits die hard, and I wanted live, console-style output. For heavyweight requirements, you could go to extremes and use a plug-in logger like Serilog. If the data is minimal, stash it into a List and dump it to a file. There are lots of other ways to accomplish similar results, of course. I was very surprised to discover Windows doesn’t support this – not even if you’re willing to p/invoke calls to the Win32 API. I recently ran into a scenario where it would be very handy to have multiple consoles. But regardless of what crusty old C programmers might think, these days I make heavy use of this approach. After all, when your only output is the character mode screen (I’m talking the really old days, the 70s and 80s), trashing everything with debug output was kind of sloppy. In the old days, dumping debug information to the console was disparagingly referred to as “printf debugging”. Update: The GitHub code for this article has been updated as a result of my newer August 2019 articles, How to Close a WebSocket (Correctly) and A Minimal Full-Feature Kestrel WebSocket Server. Learn from this simple websocket server with realistic features.
0 Comments
Leave a Reply. |