4 ms·
Telling where the output of an individual stdout print statement ends and the next one begins, so that I could color code my terminal with alternating colors to
by aerovistae 6y ago
Telling where the output of an individual stdout print statement ends and the next one begins, so that I could color code my terminal with alternating colors to more easily tell apart individual log messages from a running process by visual differentiation. Turns out this is impossible! Aside from time passing in between outputs, there's no way to tell. It's just a continuous byte stream with no terminating character or pattern.
- dredmorbius 6y agoTerminal driver + clock + colour-coding? Strace w/ individual write() instructions identified? DTrace?
- aerovistae 6y agoCan you elaborate on this? Are you saying these tools could be used to wrap a running process in such a way that you could tell apart individual print statements during runtime? (I haven't used the tools you suggest.)
- dredmorbius 6y agoYes, basically. The strace option should be doable. Terminal & timer a bit more work. So long as the print statements come between other blocks of code, though, I'd look at strace (or dtrace, gdb, etc.). Assuming Linux/Unix OS.
- aerovistae 6y agoI'll research it, thank you. If I can't figure it out (I'm not great at systems-level programming), are you available for a small amount of contract work?
- dredmorbius 6y agoEmail contact is in my description. Let me know what OS / processes you're working with. I'm much more a shell hacker than systems programmer but this smells doable.