有没有Linux版的Windows DebugView?我想在控制台上远程监控Linux /C++程序的print语句。我对监控用户空间程序很感兴趣(我尝试过使用dmesg,但它只适用于内核消息AFAIK)
感谢您的指点。
发布于 2011-09-06 16:29:04
看看syslog工具(man syslog) --它是用于记录输出的标准Unix/Linux框架。大多数现代实现(syslog-ng、rsyslog)允许非常高级的配置,包括通过网络分发日志消息等。
更新:
如果您只想捕获一组程序的输出,同时允许它们像往常一样打印到控制台,那么您可以使用'tee‘。例如
prog1 | tee outputs & # start prog1 and copy stdout to the file "outputs" as well
prog2 | tee -a outputs & # start prog2 and append stdout to the file "outputs"然后,从另一个地方,您可以观察到如何使用tail填充outputs。即
tail -f outputs或
tail -f outputs | nc -l 9999如果您想通过网络读取输出(只需telnet到端口9999上的机器)
发布于 2011-09-06 15:28:47
我不确定这是否合适,但也许strace可以工作。Strace将打印作为参数make传递的程序的每个系统调用。
https://stackoverflow.com/questions/7316259
复制相似问题