-
-
Notifications
You must be signed in to change notification settings - Fork 420
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
Integrating FTXUI in an application with an existing logging system #947
Comments
I wanted to do something similar, see #778 so you know what kind of issues I encountered while doing so On the topic of redirection: I suspect it isn't possible to separate regular stdout from what FTXUI uses to draw, but if the logging system allows for attachment points it should be fine. Alternatively, there's probably a way to run the program as a child process with its own stdout handle, which you can then forward somehow to FTXUI in the main process. |
In particular, in (example 2), you see // Save the original stdin:
int original_stdin_file_descriptor = dup(fileno(stdin))
// Change stdin to handle user input instead of the piped software:
stdin = freopen("/dev/tty", "r", stdin);
// TODO("Do something with `original_stdin_file_descriptor") Does (1) or (2) fits your intents? |
I think creating a subprocess (example 1) would better suit my case. I will try this sooner or later, as it is not a high priority work at the moment. Thank you all for such valuable information 🙏🏻 |
Hello, I would like to know if it is possible to use this library with existing C++ applications that already use an own logging system. I am extending the functionalities of some SDK application which outputs lots of logs into stdout (and stderr sometimes). When I use these functionalities, I would like to use FTXUI to split the terminal in two sections, one just prints the logs generated by the application in the standard output/error and the other one prints some stats I choose.
Is it possible to "redirect" the existing application's standard output without modifying the way the application logs things and print it in that separate section of the terminal?
Thank you in advance.
The text was updated successfully, but these errors were encountered: