logger: Fix always re-opening files when --log-fd is used
3 unresolved threads
3 unresolved threads
Compare changes
- Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
+ 44
− 13
@@ -450,6 +450,10 @@ _srt_logger_setup (SrtLogger *self,
@@ -1093,7 +1097,7 @@ _srt_logger_try_rotate (SrtLogger *self,
@@ -1216,17 +1220,26 @@ logger_process_complete_line (SrtLogger *self,
@@ -1234,17 +1247,35 @@ logger_process_complete_line (SrtLogger *self,
- Comment on lines +1275 to +1277
@refi64, as a note for the future:
When you noticed that
file_stat
was not always being updated, your next question should have been: are there any other places where we can assign tofile_fd
without also updatingfile_stat
? And if you had asked yourself that question, you'd probably have found this one too.
@refi64 please note for the future:
If we are doing something significant, we should log, especially if it's something that ought to be rare under normal circumstances. Otherwise we'll have little hope of debugging it when it goes wrong. Sorry, I should have insisted on this when I reviewed !740 (merged) before.
If we want the log message to be non-user-visible the majority of the time, we can log at
g_debug()
(-v -v
) org_info()
(-v
) level.If we want the log message to be user-visible by default, we can log at
g_message()
or higher.I think
g_info()
is proportionate here.