write errors to logs/php.log if debug level 3, show debug screen if debug > 1