Google Groups

Re: How to print log messages to the output


Jan Berkel Apr 18, 2012 4:25 AM
Posted in group: Robolectric


On Wednesday, April 18, 2012 11:18:12 AM UTC+2, StKiller wrote:
Well, there was another issue - I used the ShadowActivity instead of real one, so the app's code wasn't invoked. Changing back to use of real class solved the issue : 

At the start of the test class : 


    static {
        ShadowLog.stream = System.out;
        Robolectric.bindShadowClass(ShadowLog.class);
    }



you can also set the system property "robolectric.logging" to one of

 * stdout  (logs to stdout)
 * stderr  (logs to stderr)
 * somefilename.txt  (logs to a file)
 
i added this a while ago but it isn't documented anywhere.

   jan