# How to output error information to console?

**URL:** https://discourse.vtk.org/t/how-to-output-error-information-to-console/10820
**Category:** Support
**Created:** [February 27, 2023, 8:17am UTC](https://discourse.vtk.org/t/how-to-output-error-information-to-console/10820 "2023-02-27T08:17:50Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![zhang-qiang-github](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhang-qiang-github/32/2519_2.png) [@zhang-qiang-github](https://discourse.vtk.org/u/zhang-qiang-github)
#### Post date: [February 27, 2023, 8:17am UTC](https://discourse.vtk.org/t/how-to-output-error-information-to-console/10820/1 "2023-02-27T08:17:50Z")

</div>

`vtkOutputWindow` is used to print error/warning information.

For example:

 ![image](https://discourse.vtk.org/uploads/default/original/2X/1/1d5f97663737ce935add1dee8b42eea8356005cf.png)

Is there any method to keep the printed information but do not show the `vtkOutputWindow`?

I have tested `vtkOutputWindow::SetGlobalWarningDispaly(0)` can forbid the `vtkOutputWindow`, but it also don’t show the printed information in console.

How to output error/warning information to console but hide the `vtkOutputWindow`?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [February 27, 2023, 8:27am UTC](https://discourse.vtk.org/t/how-to-output-error-information-to-console/10820/2 "2023-02-27T08:27:50Z")

</div>

Are you setting a factory to use the vtkWin32OutputWindow ? A standard vtkOutputWindow does not show the window afaik.

---

<div class="post-metadata">

### Author: ![zhang-qiang-github](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhang-qiang-github/32/2519_2.png) [@zhang-qiang-github](https://discourse.vtk.org/u/zhang-qiang-github)
#### Post date: [February 27, 2023, 8:34am UTC](https://discourse.vtk.org/t/how-to-output-error-information-to-console/10820/3 "2023-02-27T08:34:34Z")

</div>

> Are you setting a factory to use the vtkWin32OutputWindow ?

No, I have no setting about output window. But the `vtkOutputWindow` appears when a error/warning is reported.

Now, I need the printed information, but I don’t want `vtkOutputWindow`.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [February 27, 2023, 8:36am UTC](https://discourse.vtk.org/t/how-to-output-error-information-to-console/10820/4 "2023-02-27T08:36:10Z")

</div>

You want to override with your own factory then.

---

<div class="post-metadata">

### Author: ![zhang-qiang-github](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhang-qiang-github/32/2519_2.png) [@zhang-qiang-github](https://discourse.vtk.org/u/zhang-qiang-github)
#### Post date: [February 27, 2023, 9:06am UTC](https://discourse.vtk.org/t/how-to-output-error-information-to-console/10820/5 "2023-02-27T09:06:04Z")

</div>

Why print the error/warning information to console, but also show it in `vtkOutputWindow`?

Why don’t show the error/warning information in console **or** `vtkOutputWindow`?

It is unnecessary to show the information twice.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [February 27, 2023, 9:13am UTC](https://discourse.vtk.org/t/how-to-output-error-information-to-console/10820/6 "2023-02-27T09:13:19Z")

</div>

I agree, please improve the vtkWin32OutputWindow to support all this, thanks 🙂

---

<div class="post-metadata">

### Author: ![rexthor](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rexthor/32/6481_2.png) [@rexthor](https://discourse.vtk.org/u/rexthor)
#### Post date: [March 1, 2023, 8:09pm UTC](https://discourse.vtk.org/t/how-to-output-error-information-to-console/10820/7 "2023-03-01T20:09:02Z")

</div>

I’m a Unix guy, but I would be surprised to find that windows didn’t have some way of redirecting standard error output to somewhere else. I haven’t tested this (I’m a Unix guy), but [this website](https://www.rushis.com/windows-command-prompt-redirecting-stdoutstderr/) seemed to think that it was possible to do these redirects in a Unix-y fashion on windows!
