Language: PT-BR
When you're implementing things like Linux Daemons, or any application where you don't have access to the standard IO, it's nice to have an application to receive messages from your program.
This is exactly what this application does, it connects to a TCP server on port 1337 (you can edit the port and destination IP address in the file example/debug.h).
In order not to crash the application when sending messages, Non-Blocking Socket techniques are used.
If my code has helped you, please consider sponsoring me 💙
Just add the debug.h header in your application, and use it as shown in the code below.
#include "debug.h"
int main (int argc, char *argv[])
{
/**
* Detailed message example.
*/
say_debug_detail("Iesus Hominum Salvator!");
/**
* Example of common usage.
*/
for (int a=0; a<10; a++) {
say_debug("Message %d: Iesus Hominum Salvator!", a);
sleep(1);
}
return 0;
}
To use the message visualization application (as shown in the image above), just open it using Electron. Remembering that the Electron version used is 19.0.0, and you can find it here: https://github.com/electron/electron/releases/tag/v19.0.0
All you need to do is run Electron, and specify the application directory in its parameters.
electron .
Sponsor: melchisedech333
Twitter: Melchisedech333
LinkedIn: Melchisedech Rex
Blog: melchisedech333.github.io