LogTest.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  1. <?php
  2. /**
  3. * CakePHP(tm) <https://book.cakephp.org/3/en/development/testing.html>
  4. * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  5. *
  6. * Licensed under The MIT License
  7. * Redistributions of files must retain the above copyright notice
  8. *
  9. * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  10. * @link https://cakephp.org CakePHP(tm) Project
  11. * @since 1.2.0
  12. * @license https://opensource.org/licenses/mit-license.php MIT License
  13. */
  14. namespace Cake\Test\TestCase\Log;
  15. use Cake\Core\Plugin;
  16. use Cake\Log\Engine\FileLog;
  17. use Cake\Log\Log;
  18. use Cake\TestSuite\TestCase;
  19. /**
  20. * LogTest class
  21. */
  22. class LogTest extends TestCase
  23. {
  24. public function setUp()
  25. {
  26. parent::setUp();
  27. Log::reset();
  28. }
  29. public function tearDown()
  30. {
  31. parent::tearDown();
  32. Log::reset();
  33. }
  34. /**
  35. * test importing loggers from app/libs and plugins.
  36. *
  37. * @return void
  38. */
  39. public function testImportingLoggers()
  40. {
  41. static::setAppNamespace();
  42. $this->loadPlugins(['TestPlugin']);
  43. Log::setConfig('libtest', [
  44. 'engine' => 'TestApp',
  45. ]);
  46. Log::setConfig('plugintest', [
  47. 'engine' => 'TestPlugin.TestPlugin',
  48. ]);
  49. $result = Log::engine('libtest');
  50. $this->assertInstanceOf('TestApp\Log\Engine\TestAppLog', $result);
  51. $this->assertContains('libtest', Log::configured());
  52. $result = Log::engine('plugintest');
  53. $this->assertInstanceOf('TestPlugin\Log\Engine\TestPluginLog', $result);
  54. $this->assertContains('libtest', Log::configured());
  55. $this->assertContains('plugintest', Log::configured());
  56. Log::write(LOG_INFO, 'TestPluginLog is not a BaseLog descendant');
  57. $this->clearPlugins();
  58. }
  59. /**
  60. * test all the errors from failed logger imports
  61. *
  62. * @return void
  63. */
  64. public function testImportingLoggerFailure()
  65. {
  66. $this->expectException(\RuntimeException::class);
  67. Log::setConfig('fail', []);
  68. Log::engine('fail');
  69. }
  70. /**
  71. * test config() with valid key name
  72. *
  73. * @return void
  74. */
  75. public function testValidKeyName()
  76. {
  77. Log::setConfig('valid', ['engine' => 'File']);
  78. $stream = Log::engine('valid');
  79. $this->assertInstanceOf('Cake\Log\Engine\FileLog', $stream);
  80. }
  81. /**
  82. * test that loggers have to implement the correct interface.
  83. *
  84. * @return void
  85. */
  86. public function testNotImplementingInterface()
  87. {
  88. $this->expectException(\RuntimeException::class);
  89. Log::setConfig('fail', ['engine' => '\stdClass']);
  90. Log::engine('fail');
  91. }
  92. /**
  93. * explicit tests for drop()
  94. *
  95. * @return void
  96. */
  97. public function testDrop()
  98. {
  99. Log::setConfig('file', [
  100. 'engine' => 'File',
  101. 'path' => LOGS,
  102. ]);
  103. $result = Log::configured();
  104. $this->assertContains('file', $result);
  105. $this->assertTrue(Log::drop('file'), 'Should be dropped');
  106. $this->assertFalse(Log::drop('file'), 'Already gone');
  107. $result = Log::configured();
  108. $this->assertNotContains('file', $result);
  109. }
  110. /**
  111. * test invalid level
  112. *
  113. * @return void
  114. */
  115. public function testInvalidLevel()
  116. {
  117. $this->expectException(\InvalidArgumentException::class);
  118. Log::setConfig('myengine', ['engine' => 'File']);
  119. Log::write('invalid', 'This will not be logged');
  120. }
  121. /**
  122. * Provider for config() tests.
  123. *
  124. * @return array
  125. */
  126. public static function configProvider()
  127. {
  128. return [
  129. 'Array of data using engine key.' => [[
  130. 'engine' => 'File',
  131. 'path' => TMP . 'tests',
  132. ]],
  133. 'Array of data using classname key.' => [[
  134. 'className' => 'File',
  135. 'path' => TMP . 'tests',
  136. ]],
  137. 'Direct instance' => [new FileLog(['path' => LOGS])],
  138. ];
  139. }
  140. /**
  141. * Test the various config call signatures.
  142. *
  143. * @dataProvider configProvider
  144. * @return void
  145. */
  146. public function testConfigVariants($settings)
  147. {
  148. Log::setConfig('test', $settings);
  149. $this->assertContains('test', Log::configured());
  150. $this->assertInstanceOf('Cake\Log\Engine\FileLog', Log::engine('test'));
  151. Log::drop('test');
  152. }
  153. /**
  154. * Test the various setConfig call signatures.
  155. *
  156. * @dataProvider configProvider
  157. * @return void
  158. */
  159. public function testSetConfigVariants($settings)
  160. {
  161. Log::setConfig('test', $settings);
  162. $this->assertContains('test', Log::configured());
  163. $this->assertInstanceOf('Cake\Log\Engine\FileLog', Log::engine('test'));
  164. Log::drop('test');
  165. }
  166. /**
  167. * Test that config() throws an exception when adding an
  168. * adapter with the wrong type.
  169. *
  170. * @return void
  171. */
  172. public function testConfigInjectErrorOnWrongType()
  173. {
  174. $this->expectException(\RuntimeException::class);
  175. Log::setConfig('test', new \StdClass());
  176. Log::info('testing');
  177. }
  178. /**
  179. * Test that setConfig() throws an exception when adding an
  180. * adapter with the wrong type.
  181. *
  182. * @return void
  183. */
  184. public function testSetConfigInjectErrorOnWrongType()
  185. {
  186. $this->expectException(\RuntimeException::class);
  187. Log::setConfig('test', new \StdClass());
  188. Log::info('testing');
  189. }
  190. /**
  191. * Test that config() can read data back
  192. *
  193. * @return void
  194. */
  195. public function testConfigRead()
  196. {
  197. $config = [
  198. 'engine' => 'File',
  199. 'path' => LOGS,
  200. ];
  201. Log::setConfig('tests', $config);
  202. $expected = $config;
  203. $expected['className'] = $config['engine'];
  204. unset($expected['engine']);
  205. $this->assertSame($expected, Log::getConfig('tests'));
  206. }
  207. /**
  208. * Ensure you cannot reconfigure a log adapter.
  209. *
  210. * @return void
  211. */
  212. public function testConfigErrorOnReconfigure()
  213. {
  214. $this->expectException(\BadMethodCallException::class);
  215. Log::setConfig('tests', ['engine' => 'File', 'path' => TMP]);
  216. Log::setConfig('tests', ['engine' => 'Apc']);
  217. }
  218. /**
  219. * testLogFileWriting method
  220. *
  221. * @return void
  222. */
  223. public function testLogFileWriting()
  224. {
  225. $this->_resetLogConfig();
  226. if (file_exists(LOGS . 'error.log')) {
  227. unlink(LOGS . 'error.log');
  228. }
  229. $result = Log::write(LOG_WARNING, 'Test warning');
  230. $this->assertTrue($result);
  231. $this->assertFileExists(LOGS . 'error.log');
  232. unlink(LOGS . 'error.log');
  233. Log::write(LOG_WARNING, 'Test warning 1');
  234. Log::write(LOG_WARNING, 'Test warning 2');
  235. $result = file_get_contents(LOGS . 'error.log');
  236. $this->assertRegExp('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Warning: Test warning 1/', $result);
  237. $this->assertRegExp('/2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Warning: Test warning 2$/', $result);
  238. unlink(LOGS . 'error.log');
  239. }
  240. /**
  241. * test selective logging by level/type
  242. *
  243. * @return void
  244. */
  245. public function testSelectiveLoggingByLevel()
  246. {
  247. if (file_exists(LOGS . 'spam.log')) {
  248. unlink(LOGS . 'spam.log');
  249. }
  250. if (file_exists(LOGS . 'eggs.log')) {
  251. unlink(LOGS . 'eggs.log');
  252. }
  253. Log::setConfig('spam', [
  254. 'engine' => 'File',
  255. 'path' => LOGS,
  256. 'levels' => 'debug',
  257. 'file' => 'spam',
  258. ]);
  259. Log::setConfig('eggs', [
  260. 'engine' => 'File',
  261. 'path' => LOGS,
  262. 'levels' => ['eggs', 'debug', 'error', 'warning'],
  263. 'file' => 'eggs',
  264. ]);
  265. $testMessage = 'selective logging';
  266. Log::write('warning', $testMessage);
  267. $this->assertFileExists(LOGS . 'eggs.log');
  268. $this->assertFileNotExists(LOGS . 'spam.log');
  269. Log::write('debug', $testMessage);
  270. $this->assertFileExists(LOGS . 'spam.log');
  271. $contents = file_get_contents(LOGS . 'spam.log');
  272. $this->assertContains('Debug: ' . $testMessage, $contents);
  273. $contents = file_get_contents(LOGS . 'eggs.log');
  274. $this->assertContains('Debug: ' . $testMessage, $contents);
  275. if (file_exists(LOGS . 'spam.log')) {
  276. unlink(LOGS . 'spam.log');
  277. }
  278. if (file_exists(LOGS . 'eggs.log')) {
  279. unlink(LOGS . 'eggs.log');
  280. }
  281. }
  282. /**
  283. * test selective logging by level using the `types` attribute
  284. *
  285. * @return void
  286. */
  287. public function testSelectiveLoggingByLevelUsingTypes()
  288. {
  289. if (file_exists(LOGS . 'spam.log')) {
  290. unlink(LOGS . 'spam.log');
  291. }
  292. if (file_exists(LOGS . 'eggs.log')) {
  293. unlink(LOGS . 'eggs.log');
  294. }
  295. Log::setConfig('spam', [
  296. 'engine' => 'File',
  297. 'path' => LOGS,
  298. 'types' => 'debug',
  299. 'file' => 'spam',
  300. ]);
  301. Log::setConfig('eggs', [
  302. 'engine' => 'File',
  303. 'path' => LOGS,
  304. 'types' => ['eggs', 'debug', 'error', 'warning'],
  305. 'file' => 'eggs',
  306. ]);
  307. $testMessage = 'selective logging';
  308. Log::write('warning', $testMessage);
  309. $this->assertFileExists(LOGS . 'eggs.log');
  310. $this->assertFileNotExists(LOGS . 'spam.log');
  311. Log::write('debug', $testMessage);
  312. $this->assertFileExists(LOGS . 'spam.log');
  313. $contents = file_get_contents(LOGS . 'spam.log');
  314. $this->assertContains('Debug: ' . $testMessage, $contents);
  315. $contents = file_get_contents(LOGS . 'eggs.log');
  316. $this->assertContains('Debug: ' . $testMessage, $contents);
  317. if (file_exists(LOGS . 'spam.log')) {
  318. unlink(LOGS . 'spam.log');
  319. }
  320. if (file_exists(LOGS . 'eggs.log')) {
  321. unlink(LOGS . 'eggs.log');
  322. }
  323. }
  324. protected function _resetLogConfig()
  325. {
  326. Log::setConfig('debug', [
  327. 'engine' => 'File',
  328. 'path' => LOGS,
  329. 'levels' => ['notice', 'info', 'debug'],
  330. 'file' => 'debug',
  331. ]);
  332. Log::setConfig('error', [
  333. 'engine' => 'File',
  334. 'path' => LOGS,
  335. 'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'],
  336. 'file' => 'error',
  337. ]);
  338. }
  339. protected function _deleteLogs()
  340. {
  341. if (file_exists(LOGS . 'shops.log')) {
  342. unlink(LOGS . 'shops.log');
  343. }
  344. if (file_exists(LOGS . 'error.log')) {
  345. unlink(LOGS . 'error.log');
  346. }
  347. if (file_exists(LOGS . 'debug.log')) {
  348. unlink(LOGS . 'debug.log');
  349. }
  350. if (file_exists(LOGS . 'bogus.log')) {
  351. unlink(LOGS . 'bogus.log');
  352. }
  353. if (file_exists(LOGS . 'spam.log')) {
  354. unlink(LOGS . 'spam.log');
  355. }
  356. if (file_exists(LOGS . 'eggs.log')) {
  357. unlink(LOGS . 'eggs.log');
  358. }
  359. }
  360. /**
  361. * test scoped logging
  362. *
  363. * @return void
  364. */
  365. public function testScopedLogging()
  366. {
  367. $this->_deleteLogs();
  368. $this->_resetLogConfig();
  369. Log::setConfig('shops', [
  370. 'engine' => 'File',
  371. 'path' => LOGS,
  372. 'levels' => ['info', 'debug', 'warning'],
  373. 'scopes' => ['transactions', 'orders'],
  374. 'file' => 'shops',
  375. ]);
  376. Log::write('debug', 'debug message', 'transactions');
  377. $this->assertFileNotExists(LOGS . 'error.log');
  378. $this->assertFileExists(LOGS . 'shops.log');
  379. $this->assertFileExists(LOGS . 'debug.log');
  380. $this->_deleteLogs();
  381. Log::write('warning', 'warning message', 'orders');
  382. $this->assertFileExists(LOGS . 'error.log');
  383. $this->assertFileExists(LOGS . 'shops.log');
  384. $this->assertFileNotExists(LOGS . 'debug.log');
  385. $this->_deleteLogs();
  386. Log::write('error', 'error message', ['scope' => 'orders']);
  387. $this->assertFileExists(LOGS . 'error.log');
  388. $this->assertFileNotExists(LOGS . 'debug.log');
  389. $this->assertFileNotExists(LOGS . 'shops.log');
  390. $this->_deleteLogs();
  391. Log::drop('shops');
  392. }
  393. /**
  394. * Test scoped logging without the default loggers catching everything
  395. *
  396. * @return void
  397. */
  398. public function testScopedLoggingStrict()
  399. {
  400. $this->_deleteLogs();
  401. Log::setConfig('debug', [
  402. 'engine' => 'File',
  403. 'path' => LOGS,
  404. 'levels' => ['notice', 'info', 'debug'],
  405. 'file' => 'debug',
  406. 'scopes' => false,
  407. ]);
  408. Log::setConfig('shops', [
  409. 'engine' => 'File',
  410. 'path' => LOGS,
  411. 'levels' => ['info', 'debug', 'warning'],
  412. 'file' => 'shops',
  413. 'scopes' => ['transactions', 'orders'],
  414. ]);
  415. Log::write('debug', 'debug message');
  416. $this->assertFileNotExists(LOGS . 'shops.log');
  417. $this->assertFileExists(LOGS . 'debug.log');
  418. $this->_deleteLogs();
  419. Log::write('debug', 'debug message', 'orders');
  420. $this->assertFileExists(LOGS . 'shops.log');
  421. $this->assertFileNotExists(LOGS . 'debug.log');
  422. $this->_deleteLogs();
  423. Log::drop('shops');
  424. }
  425. /**
  426. * test scoped logging with convenience methods
  427. */
  428. public function testConvenienceScopedLogging()
  429. {
  430. if (file_exists(LOGS . 'shops.log')) {
  431. unlink(LOGS . 'shops.log');
  432. }
  433. if (file_exists(LOGS . 'error.log')) {
  434. unlink(LOGS . 'error.log');
  435. }
  436. if (file_exists(LOGS . 'debug.log')) {
  437. unlink(LOGS . 'debug.log');
  438. }
  439. $this->_resetLogConfig();
  440. Log::setConfig('shops', [
  441. 'engine' => 'File',
  442. 'path' => LOGS,
  443. 'levels' => ['info', 'debug', 'notice', 'warning'],
  444. 'scopes' => ['transactions', 'orders'],
  445. 'file' => 'shops',
  446. ]);
  447. Log::info('info message', 'transactions');
  448. $this->assertFileNotExists(LOGS . 'error.log');
  449. $this->assertFileExists(LOGS . 'shops.log');
  450. $this->assertFileExists(LOGS . 'debug.log');
  451. $this->_deleteLogs();
  452. Log::error('error message', 'orders');
  453. $this->assertFileExists(LOGS . 'error.log');
  454. $this->assertFileNotExists(LOGS . 'debug.log');
  455. $this->assertFileNotExists(LOGS . 'shops.log');
  456. $this->_deleteLogs();
  457. Log::warning('warning message', 'orders');
  458. $this->assertFileExists(LOGS . 'error.log');
  459. $this->assertFileExists(LOGS . 'shops.log');
  460. $this->assertFileNotExists(LOGS . 'debug.log');
  461. $this->_deleteLogs();
  462. Log::drop('shops');
  463. }
  464. /**
  465. * Test that scopes are exclusive and don't bleed.
  466. *
  467. * @return void
  468. */
  469. public function testScopedLoggingExclusive()
  470. {
  471. $this->_deleteLogs();
  472. Log::setConfig('shops', [
  473. 'engine' => 'File',
  474. 'path' => LOGS,
  475. 'levels' => ['debug', 'notice', 'warning'],
  476. 'scopes' => ['transactions', 'orders'],
  477. 'file' => 'shops.log',
  478. ]);
  479. Log::setConfig('eggs', [
  480. 'engine' => 'File',
  481. 'path' => LOGS,
  482. 'levels' => ['debug', 'notice', 'warning'],
  483. 'scopes' => ['eggs'],
  484. 'file' => 'eggs.log',
  485. ]);
  486. Log::write('debug', 'transactions message', 'transactions');
  487. $this->assertFileNotExists(LOGS . 'eggs.log');
  488. $this->assertFileExists(LOGS . 'shops.log');
  489. $this->_deleteLogs();
  490. Log::write('debug', 'eggs message', ['scope' => ['eggs']]);
  491. $this->assertFileExists(LOGS . 'eggs.log');
  492. $this->assertFileNotExists(LOGS . 'shops.log');
  493. }
  494. /**
  495. * testPassingScopeToEngine method
  496. */
  497. public function testPassingScopeToEngine()
  498. {
  499. static::setAppNamespace();
  500. Log::reset();
  501. Log::setConfig('scope_test', [
  502. 'engine' => 'TestApp',
  503. 'path' => LOGS,
  504. 'levels' => ['notice', 'info', 'debug'],
  505. 'scopes' => ['foo', 'bar'],
  506. ]);
  507. $engine = Log::engine('scope_test');
  508. $this->assertNull($engine->passedScope);
  509. Log::write('debug', 'test message', 'foo');
  510. $this->assertEquals(['scope' => ['foo']], $engine->passedScope);
  511. Log::write('debug', 'test message', ['foo', 'bar']);
  512. $this->assertEquals(['scope' => ['foo', 'bar']], $engine->passedScope);
  513. $result = Log::write('debug', 'test message');
  514. $this->assertFalse($result);
  515. }
  516. /**
  517. * test convenience methods
  518. */
  519. public function testConvenienceMethods()
  520. {
  521. $this->_deleteLogs();
  522. Log::setConfig('debug', [
  523. 'engine' => 'File',
  524. 'path' => LOGS,
  525. 'levels' => ['notice', 'info', 'debug'],
  526. 'file' => 'debug',
  527. ]);
  528. Log::setConfig('error', [
  529. 'engine' => 'File',
  530. 'path' => LOGS,
  531. 'levels' => ['emergency', 'alert', 'critical', 'error', 'warning'],
  532. 'file' => 'error',
  533. ]);
  534. $testMessage = 'emergency message';
  535. Log::emergency($testMessage);
  536. $contents = file_get_contents(LOGS . 'error.log');
  537. $this->assertRegExp('/(Emergency|Critical): ' . $testMessage . '/', $contents);
  538. $this->assertFileNotExists(LOGS . 'debug.log');
  539. $this->_deleteLogs();
  540. $testMessage = 'alert message';
  541. Log::alert($testMessage);
  542. $contents = file_get_contents(LOGS . 'error.log');
  543. $this->assertRegExp('/(Alert|Critical): ' . $testMessage . '/', $contents);
  544. $this->assertFileNotExists(LOGS . 'debug.log');
  545. $this->_deleteLogs();
  546. $testMessage = 'critical message';
  547. Log::critical($testMessage);
  548. $contents = file_get_contents(LOGS . 'error.log');
  549. $this->assertContains('Critical: ' . $testMessage, $contents);
  550. $this->assertFileNotExists(LOGS . 'debug.log');
  551. $this->_deleteLogs();
  552. $testMessage = 'error message';
  553. Log::error($testMessage);
  554. $contents = file_get_contents(LOGS . 'error.log');
  555. $this->assertContains('Error: ' . $testMessage, $contents);
  556. $this->assertFileNotExists(LOGS . 'debug.log');
  557. $this->_deleteLogs();
  558. $testMessage = 'warning message';
  559. Log::warning($testMessage);
  560. $contents = file_get_contents(LOGS . 'error.log');
  561. $this->assertContains('Warning: ' . $testMessage, $contents);
  562. $this->assertFileNotExists(LOGS . 'debug.log');
  563. $this->_deleteLogs();
  564. $testMessage = 'notice message';
  565. Log::notice($testMessage);
  566. $contents = file_get_contents(LOGS . 'debug.log');
  567. $this->assertRegExp('/(Notice|Debug): ' . $testMessage . '/', $contents);
  568. $this->assertFileNotExists(LOGS . 'error.log');
  569. $this->_deleteLogs();
  570. $testMessage = 'info message';
  571. Log::info($testMessage);
  572. $contents = file_get_contents(LOGS . 'debug.log');
  573. $this->assertRegExp('/(Info|Debug): ' . $testMessage . '/', $contents);
  574. $this->assertFileNotExists(LOGS . 'error.log');
  575. $this->_deleteLogs();
  576. $testMessage = 'debug message';
  577. Log::debug($testMessage);
  578. $contents = file_get_contents(LOGS . 'debug.log');
  579. $this->assertContains('Debug: ' . $testMessage, $contents);
  580. $this->assertFileNotExists(LOGS . 'error.log');
  581. $this->_deleteLogs();
  582. }
  583. /**
  584. * Test that write() returns false on an unhandled message.
  585. *
  586. * @return void
  587. */
  588. public function testWriteUnhandled()
  589. {
  590. Log::drop('error');
  591. Log::drop('debug');
  592. $result = Log::write('error', 'Bad stuff', 'impossible');
  593. $this->assertFalse($result);
  594. }
  595. /**
  596. * Tests using a callable for creating a Log engine
  597. *
  598. * @return void
  599. */
  600. public function testCreateLoggerWithCallable()
  601. {
  602. $instance = new FileLog();
  603. Log::setConfig('default', function ($alias) use ($instance) {
  604. $this->assertEquals('default', $alias);
  605. return $instance;
  606. });
  607. $this->assertSame($instance, Log::engine('default'));
  608. }
  609. }