log: add common helper log_set_target_and_open()

quite often we want to set a log target and immediately open it. Add a
common helper for that.
This commit is contained in:
Lennart Poettering
2023-02-16 16:32:41 +01:00
parent 05dd602e50
commit 1e344c1dc7
5 changed files with 13 additions and 14 deletions
+5
View File
@@ -347,6 +347,11 @@ void log_set_target(LogTarget target) {
log_target = target;
}
void log_set_target_and_open(LogTarget target) {
log_set_target(target);
log_open();
}
void log_close(void) {
/* Do not call from library code. */