From caac37f4457b7cc565f111bac14b1ce3ac379fab Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 3 Aug 2015 11:18:28 +0200 Subject: [PATCH] fix datetime warning in logger --- tests/helper/server.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- 2.30.2