gpt4 book ai didi

linux - Linux 中的 debugview 等价物

转载 作者:太空狗 更新时间:2023-10-29 12:21:15 24 4
gpt4 key购买 nike

是否有与 Windows DebugView 等效的 Linux?我想在控制台上远程监控 Linux C/C++ 程序的 print 语句。我对监视用户空间程序很感兴趣(我尝试使用 dmesg 但它仅适用于内核消息 AFAIK)

感谢任何指点。

最佳答案

看看 syslog 工具 (man syslog) - 它是用于记录输出的标准 Unix/Linux 框架。大多数现代实现(syslog-ngrsyslog)允许非常高级的配置,包括通过网络分发日志消息等。

更新:

如果您只想捕获一堆程序的输出,同时让它们像往常一样打印到控制台,那么您可以使用“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"

然后,您可以从另一个地方观察outputs 是如何使用tail 填充的。即

tail -f outputs

tail -f outputs | nc -l 9999

如果你想通过网络读取输出(只需telnet到端口9999上的机器)

关于linux - Linux 中的 debugview 等价物,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7316259/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com