Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • How about isatty(3) to see if a terminal is attached? (though I'd probably go with a -d debug flag, as something has to manually signal that, so less surprises if a terminal is somehow detected when it shouldn't) Commented Sep 30, 2016 at 19:37
  • 1
    @thrig Using isatty wouldn't do distinguish between execution by systemd and execution where the output is going to a file (if someone runs johnsprogram >johnsprogram.log then logging on stdout is clearly desired). Commented Sep 30, 2016 at 21:54
  • Your question title doesn't match the body. Commented Oct 1, 2016 at 22:40