From: Michael Wallner Date: Mon, 3 Aug 2015 09:18:28 +0000 (+0200) Subject: fix datetime warning in logger X-Git-Tag: RELEASE_2_5_2~17 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=caac37f4457b7cc565f111bac14b1ce3ac379fab;p=m6w6%2Fext-http fix datetime warning in logger --- diff --git a/tests/helper/server.inc b/tests/helper/server.inc index c522c63..6838ac1 100644 --- a/tests/helper/server.inc +++ b/tests/helper/server.inc @@ -4,6 +4,9 @@ ini_set("log_errors", true); ini_set("error_log", __DIR__."/server.log"); function logger() { + if (!ini_get("date.timezone")) { + date_default_timezone_set(@date_default_timezone_get()); + } error_log(sprintf("%s(%s): %s", basename(getenv("SCRIPT_FILENAME"), ".php"), basename(current(get_included_files()), ".inc"), @@ -46,7 +49,7 @@ function serve($cb) { } logger("serve: EOF on client %d", (int) $client); } catch (Exception $ex) { - logger("serve: Exception on client %d", (int) $client); + logger("serve: Exception on client %d: %s", (int) $client, $ex->getMessage()); /* ignore disconnect */ if ($ex->getMessage() !== "Empty message received from stream") { fprintf(STDERR, "%s\n", $ex);