Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jitify should not print warnings to stdout by default #79

Open
harrism opened this issue Oct 13, 2020 · 2 comments
Open

Jitify should not print warnings to stdout by default #79

harrism opened this issue Oct 13, 2020 · 2 comments

Comments

@harrism
Copy link

harrism commented Oct 13, 2020

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

jitify/jitify.hpp

Lines 2817 to 2821 in 3e96bcc

#if JITIFY_PRINT_LOG
std::cout << include_parent << "(" << line_num
<< "): warning: " << include_name << ": [jitify] File not found"
<< std::endl;
#endif

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 rapidsai/cudf#6117

@leofang
Copy link
Member

leofang commented Nov 6, 2020

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
Copy link
Member

leofang commented Nov 6, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants