How to redirect messages to text file?
shipleyxie opened this issue · comments
I want to write logging messages to a text file, here is what i have done.
FILE *fp_test = fopen("logging.txt","w");
log_add_fp(fp_test,"INFO");
log_info("%s is good man","rxi");
fclose(fp_test);
But i got an empty file logging.txt.
How to achieve this?
Solved!
FILE *fp_test = fopen("logging.txt","w");
log_add_fp(fp_test, LOG_INFO);
log_info("%s is good man","rxi");
fclose(fp_test);