jitify icon indicating copy to clipboard operation
jitify copied to clipboard

Jitify should not print warnings to stdout by default

Open harrism opened this issue 4 years ago • 2 comments

Jitify prints logs to stdout by default because JITIFY_PRINT_LOG is defined to 1 by default.

https://github.com/NVIDIA/jitify/blob/3e96bcceb9e42105f6a32315abb2af04585a55b0/jitify.hpp#L2817-L2821

I think it really should print warnings and errors to stderr by default, and ideally provide a way to override logs so they can be output to a file if desired.

See https://github.com/rapidsai/cudf/issues/6117

harrism avatar Oct 13 '20 00:10 harrism

I encounter the same issue when working on the Python support (cupy/cupy#4228). In Python, in principle we could intercept Jitify's output by hijacking stdout's file descriptor (I actually made this work locally), but the problem is pytest (a Python test framework used in many projects, including CuPy) also does exactly the same thing internally, so when running the test suite it would interfere with my workaround. It would be great if Jitify could optionally print the log somewhere like @harrism suggested.

leofang avatar Nov 06 '20 19:11 leofang

Even better: append the log to the raised error messages, so that when we capture it in Cython/Python, we can access the log without any file or stream I/O.

leofang avatar Nov 06 '20 20:11 leofang