Added a test logger#1229
Conversation
|
Could you move this inside a Monolog\Test\ namespace (but still in src/)? If you also wanna help out by taking care of #1197 at the same time that'd be even better :) |
|
On the other hand, I kinda wonder if this doesn't belong more in the psr/log package as it doesn't have anything monolog specific really |
|
I had the same dilemma... if I should commit it here or on the PSR. Checking PSR now again I just saw this namespace Thank you. |
|
Ok gonna close this here then. |
|
Hi @Seldaek do you think that this could be added in here now that the TestLogger is removed from |
|
@gmponos as there is still nothing specific to Monolog in that TestLogger (the monolog-specific way is to use the TestHandler of Monolog), you can maintain that in its own package. |
Hello,
I have created a TestLogger. I hope that you feel that this fits inside your package. I know that Monolog has a
TestHandlerbut I believe this is better for the following reasons:Loggerand then aTestHandler.. More properties that I have to maintain inside my code... etc etc.Loggerclass.getRecordsfunction. Even if I retrieve all the records when I need to do simple asserts I can not.. Check this:The record contains a lot of extra information that in my case they are not needed.
Even in your tests you had to do unset. So I don't need to have all these information like
formattedetc etc.All I need to test is that the API of the
LoggerInterfaceclass is called correctly.