Doing a code review with Bruno, we agreed to do some little refactoring :
* Level per exception class
- Before the whole ExceptionLog::Log method was a total rewrite of its parent, with some code duplicates... not a good idea : we should better improve LogAPI to make other similar uses possible in the future !
- The logic to get level from config must be in a GetMinLogLevel override
* Write to DB
- Pull up this functionnality in LogAPI
- Add a sCode parameter in GetLevelDefault
Doing this refactoring, I also improved :
* Test the attributes set when creating the EventIssue object : during my dev I had crashes because I didn't filled all the mandatory fields... Having a PHPUnit test checking this will prevent future bugs to happen if attributes are modified in the class or in the object creation method
* Use Throwable instead of Exception : this was added in PHP 7.0 and will allow to catch both Exception and Error
* Because we need to have 2 statements on the same line in \Combodo\iTop\Test\UnitTest\Core\Log\ExceptionLogTest::testLogInFile, I modified the editorConfig file to allow disabling the formatter using comments.