• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2007 Mockito contributors
3  * This program is made available under the terms of the MIT License.
4  */
5 package org.mockito.plugins;
6 
7 /**
8  * Mockito logger.
9  *
10  * <p>By default logs to console</p>
11  *
12  * <p>All mockito logging goes through this class and could be customized as usual Mockito plugin.</p>
13  *
14  * <h3>Using the extension point</h3>
15  *
16  * <p>Suppose you wrote an extension to customize logging, in order to tell Mockito to use it you need to put
17  * in your <strong>classpath</strong>:
18  * <ol style="list-style-type: lower-alpha">
19  *     <li>
20  *         The implementation itself, for example <code>org.awesome.mockito.AwesomeLogger</code> that
21  *         extends the <code>MockitoLogger</code>.
22  *     </li>
23  *     <li>
24  *         A file "<code>mockito-extensions/org.mockito.plugins.MockitoLogger</code>". The content of this file is
25  *         exactly a <strong>one</strong> line with the qualified name:
26  *         <code>org.awesome.mockito.AwesomeLogger</code>.
27  *      </li>
28  * </ol>
29  * </p>
30  *
31  * <p>Note that if several <code>mockito-extensions/org.mockito.plugins.MockitoLogger</code> files exists in the
32  * classpath Mockito will only use the first returned by the standard {@link ClassLoader#getResource} mechanism.
33  *
34  * @since 2.23.19
35  */
36 public interface MockitoLogger {
37     /**
38      * Log specified object.
39      *
40      * @param what to be logged
41      */
log(Object what)42     void log(Object what);
43 }
44