I'm pretty new to java and my question is probably very noobish, but I can't figure it out.
I'm having a Logger logger = Logger.getLogger(MyClass.class.getName());
And I want to get the output of that logger as a string. For example when I do
logger.info("Some message");
logger.warning(" Some warning");
I want to get a String someString = "Some message SomeWarning"
I'm looking for something similar to
ByteArrayOutputStream loggerContent = new ByteArrayOutputStream();
System.setOut(new PrintStream(loggerContent));
TextView tv = (TextView)findViewById(R.id.txt_1);
tv.setText(loggerContent.toString());
But I'm failing to achieve it. Is it possible and how?
EDIT: I want that string to be used in another activity to show it on screen.
Handlerand use that to build the string.