Обсуждение: Disabling the printStackTrace

Поиск
Список
Период
Сортировка

Disabling the printStackTrace

От
Alex Dovlecel
Дата:
hello all

Might be stupid but...

I don't want that, every time I got an exception from psql, the client driver
is printing it on the stderr (i think, or maybe on stdout). For me is just
enough to catch it and display the appropriate message in the Logger or maybe
a JDialog. :o)

How can I change this behaviour (that I really hate).

Tx
dovle

Re: Disabling the printStackTrace

От
Rainer Klute
Дата:
>I don't want that, every time I got an exception from psql, the client driver
>is printing it on the stderr (i think, or maybe on stdout). For me is just
>enough to catch it and display the appropriate message in the Logger or maybe
>a JDialog. :o)

You can use some static methods in the System class to reassign
err, out or in to alternate streams:

static void setErr(PrintStream err)

static void setIn(InputStream in)

static void setOut(PrintStream out)

Best regards
Rainer Klute

                           Rainer Klute IT-Consulting GmbH
  Dipl.-Inform.
  Rainer Klute             E-Mail:  klute@rainer-klute.de
  Körner Grund 24          Telefon: +49 172 2324824
D-44143 Dortmund           Telefax: +49 231 5349423