Linux non-blocking fifo (on demand logging)

前端 未结 10 2320
你的背包
你的背包 2020-11-29 19:20

I like to log a programs output \'on demand\'. Eg. the output is logged to the terminal, but another process can hook on the current output at any time.

The classic

10条回答
  •  悲哀的现实
    2020-11-29 20:03

    If you can install screen on the embedded device then you can run 'myprogram' in it and detach it, and reattach it anytime you want to see the log. Something like:

    $ screen -t sometitle myprogram
    Hit Ctrl+A, then d to detach it.
    

    Whenever you want to see the output, reattach it:

    $ screen -DR sometitle
    Hit Ctrl-A, then d to detach it again.
    

    This way you won't have to worry about the program output using disk space at all.

提交回复
热议问题