Lines 194-200
Link Here
|
194 |
* Allows easy collecting of log messages send thru java.util.logging API. |
194 |
* Allows easy collecting of log messages send thru java.util.logging API. |
195 |
* Overwrite and return the log level to collect logs to logging file. |
195 |
* Overwrite and return the log level to collect logs to logging file. |
196 |
* If the method returns non-null level, then the level is assigned to |
196 |
* If the method returns non-null level, then the level is assigned to |
197 |
* the <code>Logger.getLogger("")</code> and the messages reported to it |
197 |
* the <code>Logger.getLogger({@linkplain #logRoot logRoot()})</code> and the messages reported to it |
198 |
* are then send into regular log file (which is accessible thru {@link NbTestCase#getLog}) |
198 |
* are then send into regular log file (which is accessible thru {@link NbTestCase#getLog}) |
199 |
* and in case of failure the last few messages is also included |
199 |
* and in case of failure the last few messages is also included |
200 |
* in <code>failure.getMessage()</code>. |
200 |
* in <code>failure.getMessage()</code>. |
Lines 209-214
Link Here
|
209 |
} |
209 |
} |
210 |
|
210 |
|
211 |
/** |
211 |
/** |
|
|
212 |
* If overriding {@link #logLevel}, may override this as well to collect messages from only some code. |
213 |
* @return {@code ""} (default) to collect messages from all loggers; or {@code "my.pkg"} or {@code "my.pkg.Class"} etc. |
214 |
* @since XXX |
215 |
*/ |
216 |
protected String logRoot() { |
217 |
return ""; |
218 |
} |
219 |
|
220 |
/** |
212 |
* Runs the test case, while conditionally skip some according to result of |
221 |
* Runs the test case, while conditionally skip some according to result of |
213 |
* {@link #canRun} method. |
222 |
* {@link #canRun} method. |
214 |
*/ |
223 |
*/ |
Lines 223-229
Link Here
|
223 |
} catch(BackingStoreException bex) {} |
232 |
} catch(BackingStoreException bex) {} |
224 |
Level lev = logLevel(); |
233 |
Level lev = logLevel(); |
225 |
if (lev != null) { |
234 |
if (lev != null) { |
226 |
Log.configure(lev, NbTestCase.this); |
235 |
Log.configure(lev, logRoot(), NbTestCase.this); |
227 |
} |
236 |
} |
228 |
super.run(result); |
237 |
super.run(result); |
229 |
} |
238 |
} |