Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Terminal driver + clock + colour-coding? Strace w/ individual write() instructions identified? DTrace?


Can 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.)


Yes, 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.


I'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?


Email 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: