简体   繁体   English

筛选C ++ / Win32命令行输出消息

[英]Filtering C++/Win32 command line output message

I have a Win32/C++ Command line program which displays message using "printf()" function. 我有一个Win32 / C ++命令行程序,该程序使用“ printf()”函数显示消息。 The program uses a 3rd party lib/dll which generates log message to the same console screen. 该程序使用第3方lib / dll,它会在同一控制台屏幕上生成日志消息。

So is there a way to redirect all output messages to a PLACE and filter my own message to the console screen? 那么,有没有办法将所有输出消息重定向到PLACE并将我自己的消息过滤到控制台屏幕?

There are 3 main 'streams' that console application may have: 控制台应用程序可能具有3个主要“流”:

  1. Standard output 标准输出
  2. Error output 错误输出
  3. Log output 日志输出

More info here 更多信息在这里

Now you can redirect one/all/multiple outputs to file, or any other stream like here 现在,您可以将一个/全部/多个输出重定向到文件,或其他类似此处的

Then when you have file you can read and then filter to way that you like to see. 然后,当您拥有文件时,您可以阅读,然后过滤到喜欢的方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM