| Index: docs/android_logging.md
|
| diff --git a/docs/android_logging.md b/docs/android_logging.md
|
| index c8404e3ba461944780747ed9307d0920ea74ab57..382d2f19048bdcb6ec82f67f770e2504a74c83dd 100644
|
| --- a/docs/android_logging.md
|
| +++ b/docs/android_logging.md
|
| @@ -206,3 +206,23 @@ further.
|
|
|
| For more, see the [related page on developer.android.com]
|
| (http://developer.android.com/tools/debugging/debugging-log.html#filteringOutput)
|
| +
|
| +## Logs in JUnit tests
|
| +
|
| +We use [robolectric](http://robolectric.org/) to run our JUnit tests. It
|
| +replaces some of the Android framework classes with "Shadow" classes
|
| +to ensure that we can run our code in a regular JVM. `android.util.Log` is one
|
| +of those replaced classes, and by default calling `Log` methods doesn't print
|
| +anything.
|
| +
|
| +That default is not changed in the normal configuration, but if you need to
|
| +enable logging locally or for a specific test, just add those few lines to your
|
| +test:
|
| +
|
| +```java
|
| +@Before
|
| +public void setUp() {
|
| + ShadowLog.stream = System.out;
|
| + //you other setup here
|
| +}
|
| +```
|
|
|