logging works ( but it's buggy 😭 )
This commit is contained in:
+7
-3
@@ -1,14 +1,18 @@
|
||||
#include "dynstr.h"
|
||||
|
||||
|
||||
int write_log(String_t* string, int lines) {
|
||||
int write_log(String_t* string) {
|
||||
|
||||
FILE* file = fopen("log.txt", "a");
|
||||
int numlines;
|
||||
String_t* lines = str_lines(string, &numlines);
|
||||
|
||||
for (int i = 0; i < lines; i++) {
|
||||
str_to_file(&string[i], file);
|
||||
for (int i = 0; i < numlines; i++) {
|
||||
str_to_file(&lines[i], file);
|
||||
}
|
||||
|
||||
fclose(file);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user