Java Code Examples for org.robolectric.shadows.ShadowLog#setLoggable()
The following examples show how to use
org.robolectric.shadows.ShadowLog#setLoggable() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LogUtilsTest.java From android-test with Apache License 2.0 | 5 votes |
@Test public void logDebug_isLoggableEnabled() { ShadowLog.setLoggable(LogUtilsTest.class.getSimpleName(), Log.DEBUG); String message = "Order me a %s"; LogUtil.logDebug(LogUtilsTest.class.getSimpleName(), message, "latte"); assertThat(ShadowLog.getLogsForTag(LogUtilsTest.class.getSimpleName()).get(0).msg) .contains("Order me a latte"); }
Example 2
Source File: LogUtilsTest.java From android-test with Apache License 2.0 | 5 votes |
@Test public void logDebug_isLoggableDisabled() { ShadowLog.setLoggable(LogUtilsTest.class.getSimpleName(), Log.INFO); String message = "Order me a %s"; LogUtil.logDebug(LogUtilsTest.class.getSimpleName(), message, "latte"); assertThat(ShadowLog.getLogsForTag(LogUtilsTest.class.getSimpleName())).isEmpty(); }