mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
logger: set linebuffering for the log
Set this once during setup so we don't have to remember to call fflush() after each logging operation. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
1c083a6d69
commit
c049689884
1 changed files with 2 additions and 3 deletions
|
|
@ -157,8 +157,6 @@ impl_log_logv(void *object,
|
|||
} else
|
||||
fputs(location, impl->file);
|
||||
|
||||
fflush(impl->file);
|
||||
|
||||
#undef RESERVED_LENGTH
|
||||
}
|
||||
|
||||
|
|
@ -202,7 +200,6 @@ static void on_trace_event(struct spa_source *source)
|
|||
fwrite(impl->trace_data, avail - first, 1, impl->file);
|
||||
}
|
||||
spa_ringbuffer_read_update(&impl->trace_rb, index + avail);
|
||||
fflush(impl->file);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -318,6 +315,8 @@ impl_init(const struct spa_handle_factory *factory,
|
|||
|
||||
spa_log_debug(&this->log, NAME " %p: initialized", this);
|
||||
|
||||
setlinebuf(this->file);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue