mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Write to logfile as soon as we have the data, don't buffer.
Logfiles are important to see what happend, in particular if something unexpected happened; so we want to make sure that the logfile is flushed to disk. Before this change, the logfile was typically written at the end in a large chunk as the default (large) buffering applied. Now, characters are written out ASAP, so it is possible to get a live-view with a tail -f <logfile>
This commit is contained in:
parent
08fd18e803
commit
763a09e172
1 changed files with 1 additions and 0 deletions
|
|
@ -40,6 +40,7 @@ void log_open(const char *filename)
|
||||||
log_error = true;
|
log_error = true;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
setvbuf(fp, NULL, _IONBF, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void log_write(char c)
|
void log_write(char c)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue