Detect if interactive or script mode

What is “simple script mode”?

I usually want to be able to turn on or off logging to stdout depending on operating system and/or if I am debugging.

For this I use a command line option quite often.