Suppress registerMimeType output on console

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Suppress registerMimeType output on console

Christian Schneider
I am writing a sling pax exam test and get a lot of lines like

registerMimeType: Add mapping ez=application/andrew-inset

Does anyone know how to suppress this? It does not seem to be a log output.

Christian


--
--
Christian Schneider
http://www.liquid-reality.de

Computer Scientist
http://www.adobe.com
Reply | Threaded
Open this post in threaded view
|

Re: Suppress registerMimeType output on console

Bertrand Delacretaz
Hi Christian,On Mon, Apr 23, 2018 at 9:36 AM, Christian Schneider
<[hidden email]> wrote:
> I am writing a sling pax exam test and get a lot of lines like
> registerMimeType: Add mapping ez=application/andrew-inset ...

It looks like this comes from MimeTypeServiceImpl.java#L155 [1], as a
DEBUG log message.

-Bertrand

[1] https://github.com/apache/sling-org-apache-sling-commons-mime/blob/master/src/main/java/org/apache/sling/commons/mime/internal/MimeTypeServiceImpl.java#L155
Reply | Threaded
Open this post in threaded view
|

Re: Suppress registerMimeType output on console

Christian Schneider
It seems the class checks if there is a log service installed and prints
out directly if not.

I wonder if we could change this code to simply log via the slf4j API. This
way the logging could be configured using the usual logging configs.

In my case I use logback and no logservice. So I could try to install a
logservice of course.

Christian

2018-04-23 11:45 GMT+02:00 Bertrand Delacretaz <[hidden email]>:

> Hi Christian,On Mon, Apr 23, 2018 at 9:36 AM, Christian Schneider
> <[hidden email]> wrote:
> > I am writing a sling pax exam test and get a lot of lines like
> > registerMimeType: Add mapping ez=application/andrew-inset ...
>
> It looks like this comes from MimeTypeServiceImpl.java#L155 [1], as a
> DEBUG log message.
>
> -Bertrand
>
> [1] https://github.com/apache/sling-org-apache-sling-
> commons-mime/blob/master/src/main/java/org/apache/sling/
> commons/mime/internal/MimeTypeServiceImpl.java#L155
>



--
--
Christian Schneider
http://www.liquid-reality.de

Computer Scientist
http://www.adobe.com
Reply | Threaded
Open this post in threaded view
|

Re: Suppress registerMimeType output on console

Bertrand Delacretaz
On Mon, Apr 23, 2018 at 9:59 AM, Christian Schneider
<[hidden email]> wrote:
> ...It seems the class checks if there is a log service installed and prints
> out directly if not...

Ah yes, MimeTypeServiceImpl.log(...)

That code's been there forever [1] but I don't think it's useful, +1
to just using the log.

-Bertrand

[1] https://svn.apache.org/viewvc/sling/trunk/bundles/commons/mime/src/main/java/org/apache/sling/commons/mime/internal/MimeTypeServiceImpl.java?revision=574179&view=markup