-
-
Notifications
You must be signed in to change notification settings - Fork 331
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
Turn off logging #37
Comments
👍 +1 I am looking for the same option. What about? val dependency = mockk<Dependency>(logging = false) |
It would complicate things I believe. If I would just do `info` messages
`debug` would that solve the issue?
2018-03-06 17:18 GMT+01:00 tomkoptel <notifications@github.com>:
… 👍 +1 I am looking for the same option. What about?
val dependency = mockk<Dependency>(logging = false)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#37 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFAbjIVr9wEukEymGbXiVAgozLCrNvR9ks5tbrbcgaJpZM4SesTs>
.
|
What do you propose? To disable |
I propose to not have |
It sounds like it is required to have |
Yes, |
I like the idea of not showing any logs by default. Frameworks like mockito also don't do this for example. I think that the logs are only useful when debugging the code so being able to easily turn this on/off would be a win I think. |
The idea was to keep one top-level info message. It can help to see what has answered actually in your tests by mocking library. But I think this easily can be switched to DEBUG |
Me personally not against the logging it was a good idea, but when you put additional logs in the source code to see sequence call with your tests it becomes a little bit noisy from the mock instances. I would still prefer to have logs, but with an option to disable them on demand. To use |
Version 1.7.10 released, please check if by default has no logging and close the ticket. |
Awesome thanks so much, it works:) Really appreciate it! |
@oleksiyp I'm confused by this. I don't want mockk logging and I use slf4j myself, but my logback is handled by dropwizard, so I don't have a logback.xml or test-logback.xml. Do I still need to create and configure a test-logback.xml to disable logging. It makes finding build failures in gradle output frustrating because there are all these mock DEBUG statements I have to wade through |
Unfortunately, DEBUG is what MockK cannot live without. I usually request to turn on DEBUG logging to capture what is happening on the other side. It is pretty weird that it is turned on by default for tests with Dropwizard. So you need to configure I can think of a switch in MockK properties, but you will still need to create some file with settings, so that is almost the same as creation of |
I figured it out, thanks, I don't know why it was Debug by default
…On Wed, Oct 31, 2018, 11:58 AM Oleksiy Pylypenko ***@***.***> wrote:
Unfortunately, DEBUG is what MockK cannot live without. I usually request
to turn on DEBUG logging to capture what is happening on the other side. It
is pretty weird that it is turned on by default for tests with Dropwizard.
So you need to configure test-logback.xml to fix it.
I can think of a switch in MockK properties, but you will still need to
create some file with settings, so that is almost the same as creation of
test-logback.xml
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#37 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABlGHRS6mryhEDPd-T_jkR49kNyC1FSSks5uqci3gaJpZM4SesTs>
.
|
I tried adding test-logback.xml (and logback-test.xml) with following content: <configuration>
<root level="warn"/>
</configuration> This doesn't seem to affect logging in any way, my log is still full of |
For those curious: Mockk uses Logback. You need to add an Then, in the xml, add something like this:
Notes:
Some links for reference: |
After multiple hours I am still unable to turn off the DEBUG logs of mockk in my multiplatform project. I enabled standard streams for my test logging:
I tried to add the
But nothing seems to work. I want logging for all my INFO level logs but not the DEBUG level logs from mockk. |
I got it to work in my multiplatform project where I have tests in |
Thanks for this project. Really great stuff!!
I was wondering whether it is possible to turn off logging? I am getting all kinds of output such as
INFO
messages in the console.Thanks in advance
The text was updated successfully, but these errors were encountered: