How can I print to Stderr in Go without using log

If you don’t want timestamps, just create a new log.Logger with flag set to 0: l := log.New(os.Stderr, “”, 0) l.Println(“log msg”) EDIT: Is the following good Go? os.Stderr.WriteString(“Message”) This is acceptable, and you can also use fmt.Fprintf and friends to get formatted output: fmt.Fprintf(os.Stderr, “number of foo: %d”, nFoo)

PHP Error handling: die() Vs trigger_error() Vs throw Exception

The first one should never be used in production code, since it’s transporting information irrelevant to end-users (a user can’t do anything about “Cannot connect to database”). You throw Exceptions if you know that at a certain critical code point, your application can fail and you want your code to recover across multiple call-levels. trigger_error() … Read more

Analytics Google API Error 403: “User does not have any Google Analytics Account”

I had this problem too. I fixed it by adding the email address for my service account to the Google Analytics profile I wanted it to access. I got the email address (something like xxxxxx@developer.gserviceaccount.com) for the service account by looking under the “API Access” tab in the Google APIs console. Then, I followed Google’s … Read more

Where does PHP store the error log? (PHP 5, Apache, FastCGI, and cPanel)

PHP stores error logs in /var/log/apache2 if PHP is an apache2 module. Shared hosts are often storing log files in your root directory /log subfolder. But…if you have access to a php.ini file you can do this: error_log = /var/log/php-scripts.log According to rinogo‘s comment: If you’re using cPanel, the master log file you’re probably looking … Read more