-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a test logger #1229
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
TestHandler
but I believe this is better for the following reasons:Logger
and then aTestHandler
.. More properties that I have to maintain inside my code... etc etc.Logger
class.getRecords
function. 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
formatted
etc etc.All I need to test is that the API of the
LoggerInterface
class is called correctly.