-1

I am using STS 3.4 and working on a web application based on Grails framework.

When i try to use System.err.println in groovy classes it does not print anything on standard eclipse console(STS console).

Actually there are times when in print things but that is like 1 in 10, I couldn't understand this random behavior.

I am using some library that uses System.err.println for debugging purposes but i could not get any debugging info. All i need to know is where and how to get System.err.println output?

Please help me, Thanks in advance

tim_yates
  • 154,107
  • 23
  • 313
  • 320
Sachin Verma
  • 3,334
  • 9
  • 31
  • 66

2 Answers2

0

If it is a random behaviour, it may be not-flush-ed buffered stream. Especially, that can happen when output comes from different thread.

As a solution, you can hook in into System.err dispatching (it's a stream, that you can set from outside), and overload functions, to get desired output anywhere you want. Or simply force flush it. But be careful, as it may lead to performance problems.

Seagull
  • 12,388
  • 1
  • 27
  • 43
-1

Consider using logging instead for more standard and configurable output. This should help you to set it up: http://groovy.codehaus.org/Logging

Guy Bouallet
  • 2,073
  • 9
  • 16
  • Link-only answers aren't best suited to stackoverflow. Mind adding an excerpt from the page you are referencing? – toasted_flakes Jan 28 '14 at 08:58
  • I clearly stated I am using some library that uses System.err.How can i modify it? Please understand question completely before putting an answer – Sachin Verma Jan 28 '14 at 09:35