# Feature: logging support

**URL:** https://discourse.vtk.org/t/feature-logging-support/171
**Category:** Development
**Created:** [January 30, 2019, 3:35pm UTC](https://discourse.vtk.org/t/feature-logging-support/171 "2019-01-30T15:35:50Z")
**Posts on this page:** 5
**Page:** 2

<div class="post-metadata">

### Author: ![allison.vacanti](https://discourse.vtk.org/user_avatar/discourse.vtk.org/allison.vacanti/32/679_2.png) [@allison.vacanti](https://discourse.vtk.org/u/allison.vacanti)
#### Post date: [February 19, 2019, 12:36pm UTC](https://discourse.vtk.org/t/feature-logging-support/171/21 "2019-02-19T12:36:37Z")

</div>

It looks like the test driver argument parser consumes some of the args, erasing them from argc/argv. Running tests with certain arguments created a case where argc==0, and loguru doesn’t like that…

[https://gitlab.kitware.com/vtk/vtk/merge\_requests/5220](https://gitlab.kitware.com/vtk/vtk/merge_requests/5220) should fix the issue and prevent future issues like this. Can you test it and let me know if that solves it for you?

---

<div class="post-metadata">

### Author: ![utkarshayachit](https://discourse.vtk.org/user_avatar/discourse.vtk.org/utkarshayachit/32/379_2.png) [@utkarshayachit](https://discourse.vtk.org/u/utkarshayachit)
#### Post date: [February 19, 2019, 1:04pm UTC](https://discourse.vtk.org/t/feature-logging-support/171/22 "2019-02-19T13:04:24Z")

</div>

@allison.vacanti, what confuses me is why this doesn’t happen locally or on the dashboards? These tests are being run with the same arg parsing test driver code everywhere.

---

<div class="post-metadata">

### Author: ![allison.vacanti](https://discourse.vtk.org/user_avatar/discourse.vtk.org/allison.vacanti/32/679_2.png) [@allison.vacanti](https://discourse.vtk.org/u/allison.vacanti)
#### Post date: [February 19, 2019, 1:15pm UTC](https://discourse.vtk.org/t/feature-logging-support/171/23 "2019-02-19T13:15:43Z")

</div>

The generated test drivers, like `[buildDir]/Rendering\Annotation\Testing\Cxx\vtkRenderingAnnotationCxxTests.cxx`, do things in main like:

```cpp
int main(int ac, char *av[])
{
...
ac -= 2;
av += 2;
...
}

```

and picking the right code paths through can leave ac == 0. I could reproduce this by running the `vtkRenderingAnnotationCxxTests` executable with no arguments and manually selecting the test by number.

---

<div class="post-metadata">

### Author: ![jal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jal/32/729_2.png) [@jal](https://discourse.vtk.org/u/jal)
#### Post date: [February 19, 2019, 6:28pm UTC](https://discourse.vtk.org/t/feature-logging-support/171/24 "2019-02-19T18:28:39Z")

</div>

Hi Allison,  
The fix you referenced works for me. And yes, I was just running the tests by typing in the number, so it was a miscommunication of workflow. I didn’t realize that you were not testing both ways to run them.

Thanks again, best regards

Jeff

---

<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: [December 12, 2021, 2:14pm UTC](https://discourse.vtk.org/t/feature-logging-support/171/25 "2021-12-12T14:14:06Z")

</div>

It would be nice if vtkLogger::IsEnabled was controllable application side. RIght now, it is required to play with verbosity to handle the showing, or not, of vtk error messages.

That would be easy to add, should I go ahead and add it @utkarshayachit ?

[Previous page](https://discourse.vtk.org/t/feature-logging-support/171.md?page=1)
