Getting console output

Hi, today a bit unusual question. Is that possible to get console logs? For example to store them in List, and let me do stuff with it?

Its the same as regular java. Just create a wrapper so you can catch the output.

If you dont know the java way, here is a basic idea