Commit Graph

8 Commits

Author SHA1 Message Date
Pierre Goiffon
0e14be8b15 N°4261 Refactor ExceptionLog (#239)
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.
2021-10-20 16:01:08 +02:00
Pierre Goiffon
69ad10785b 🔧 .editorConfig : disable PHP variables alignement
Still enabled for key/value pairs though ! Example in \UtilsTest::ConvertToBytesProvider
2021-07-05 12:34:20 +02:00
Pierre Goiffon
ad9726b64c 🔧 .editorConfig : restore old ij_visual_guides value
Was overwritten by mistake in 19505649
2021-06-30 10:24:19 +02:00
Pierre Goiffon
195056492e 🔧 .editorConfig : enable var alignement 2021-06-29 16:45:18 +02:00
Pierre Goiffon
caa2a05bf4 🔧 restore .editorconfig
Was moved to /test by mistake
And also editorconfig syntax was removed :(
Those mistakes were done in 7f15eed9
Thanks Molkobain, good catch !
2021-05-26 15:19:40 +02:00
Pierre Goiffon
7f15eed9a8 🔧 Update .editorconfig
* Preserve XML line breaks
* Add markdown
* Add editorconfig
2021-05-25 15:50:23 +02:00
Molkobain
38bc2d9d58 🔧 Change max line length in .editorConfig 2021-02-15 13:49:39 +01:00
Pierre Goiffon
066a6d8b36 🔧 Use same .editorconfig in all supported branches 2021-01-25 09:12:38 +01:00