22 $message = $formatter->format(
array(
23 'level_name' =>
'WARNING',
27 'datetime' =>
new \DateTime,
30 $this->assertEquals(
'['.
date(
'Y-m-d').
'] log.WARNING: foo [] []'.
"\n", $message);
36 $message = $formatter->format(
array(
37 'level_name' =>
'ERROR',
40 'datetime' =>
new \DateTime,
49 $this->assertEquals(
'['.
date(
'Y-m-d').
'] meh.ERROR: foo {"foo":"bar","baz":"qux","bool":false,"null":null} []'.
"\n", $message);
55 $message = $formatter->format(
array(
56 'level_name' =>
'ERROR',
59 'datetime' =>
new \DateTime,
60 'extra' =>
array(
'ip' =>
'127.0.0.1'),
63 $this->assertEquals(
'['.
date(
'Y-m-d').
'] meh.ERROR: log [] {"ip":"127.0.0.1"}'.
"\n", $message);
68 $formatter =
new LineFormatter(
"[%datetime%] %channel%.%level_name%: %message% %context% %extra.file% %extra%\n",
'Y-m-d');
69 $message = $formatter->format(
array(
70 'level_name' =>
'ERROR',
73 'datetime' =>
new \DateTime,
74 'extra' =>
array(
'ip' =>
'127.0.0.1',
'file' =>
'test'),
77 $this->assertEquals(
'['.
date(
'Y-m-d').
'] meh.ERROR: log [] test {"ip":"127.0.0.1"}'.
"\n", $message);
83 $message = $formatter->format(
array(
84 'level_name' =>
'ERROR',
87 'datetime' =>
new \DateTime,
91 $this->assertEquals(
'['.
date(
'Y-m-d').
'] meh.ERROR: log '.
"\n", $message);
96 $formatter =
new LineFormatter(
'%context.foo% => %extra.foo%');
97 $message = $formatter->format(
array(
98 'level_name' =>
'ERROR',
100 'context' =>
array(
'foo' =>
'bar'),
101 'datetime' =>
new \DateTime,
102 'extra' =>
array(
'foo' =>
'xbar'),
105 $this->assertEquals(
'bar => xbar', $message);
111 $message = $formatter->format(
array(
112 'level_name' =>
'ERROR',
114 'context' =>
array(),
115 'datetime' =>
new \DateTime,
116 'extra' =>
array(
'foo' =>
new TestFoo,
'bar' =>
new TestBar,
'baz' =>
array(),
'res' => fopen(
'php://memory',
'rb')),
117 'message' =>
'foobar',
120 $this->assertEquals(
'['.
date(
'Y-m-d').
'] meh.ERROR: foobar [] {"foo":"[object] (Monolog\\\\Formatter\\\\TestFoo: {\\"foo\\":\\"foo\\"})","bar":"[object] (Monolog\\\\Formatter\\\\TestBar: bar)","baz":[],"res":"[resource] (stream)"}'.
"\n", $message);
126 $message = $formatter->format(
array(
127 'level_name' =>
'CRITICAL',
130 'datetime' =>
new \DateTime,
132 'message' =>
'foobar',
135 $path = str_replace(
'\\/',
'/', json_encode(__FILE__));
137 $this->assertEquals(
'['.
date(
'Y-m-d').
'] core.CRITICAL: foobar {"exception":"[object] (RuntimeException(code: 0): Foo at '.substr(
$path, 1, -1).
':'.(__LINE__ - 8).
')"} []'.
"\n", $message);
143 $previous = new \LogicException(
'Wut?');
144 $message = $formatter->format(
array(
145 'level_name' =>
'CRITICAL',
148 'datetime' =>
new \DateTime,
150 'message' =>
'foobar',
153 $path = str_replace(
'\\/',
'/', json_encode(__FILE__));
155 $this->assertEquals(
'['.
date(
'Y-m-d').
'] core.CRITICAL: foobar {"exception":"[object] (RuntimeException(code: 0): Foo at '.substr(
$path, 1, -1).
':'.(__LINE__ - 8).
', LogicException(code: 0): Wut? at '.substr(
$path, 1, -1).
':'.(__LINE__ - 12).
')"} []'.
"\n", $message);
161 $message = $formatter->formatBatch(
array(
163 'level_name' =>
'CRITICAL',
166 'context' =>
array(),
167 'datetime' =>
new \DateTime,
171 'level_name' =>
'WARNING',
174 'context' =>
array(),
175 'datetime' =>
new \DateTime,
179 $this->assertEquals(
'['.
date(
'Y-m-d').
'] test.CRITICAL: bar [] []'.
"\n".
'['.
date(
'Y-m-d').
'] log.WARNING: foo [] []'.
"\n", $message);
185 $message = $formatter->format(
187 'message' =>
"foo\nbar",
188 'context' =>
array(),
193 $this->assertRegExp(
'/foo bar/', $message);
199 $message = $formatter->format(
201 'message' =>
"foo\nbar",
202 'context' =>
array(),
207 $this->assertRegExp(
'/foo\nbar/', $message);
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Create styles array
The data for the language used.