1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-19 23:56:17 +02:00

Merge pull request #159 from dlsniper/no-use-speed-bump

Deferred timezone creation
This commit is contained in:
Jordi Boggiano
2013-02-10 14:19:11 -08:00

View File

@@ -109,10 +109,6 @@ class Logger implements LoggerInterface
public function __construct($name) public function __construct($name)
{ {
$this->name = $name; $this->name = $name;
if (!static::$timezone) {
static::$timezone = new \DateTimeZone(date_default_timezone_get() ?: 'UTC');
}
} }
/** /**
@@ -187,6 +183,11 @@ class Logger implements LoggerInterface
if (!$this->handlers) { if (!$this->handlers) {
$this->pushHandler(new StreamHandler('php://stderr', static::DEBUG)); $this->pushHandler(new StreamHandler('php://stderr', static::DEBUG));
} }
if (!static::$timezone) {
static::$timezone = new \DateTimeZone(date_default_timezone_get() ?: 'UTC');
}
$record = array( $record = array(
'message' => (string) $message, 'message' => (string) $message,
'context' => $context, 'context' => $context,