mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 21:34:54 +03:00
logging: use the log cleaner
Actually use the log cleaner introduced by previous commit. Signed-off-by: Oleg Vasilev <oleg.vasilev@virtuozzo.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
69eeef5dfb
commit
515b24228f
@ -21,6 +21,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "log_handler.h"
|
||||
#include "log_cleaner.h"
|
||||
#include "virerror.h"
|
||||
#include "virfile.h"
|
||||
#include "viralloc.h"
|
||||
@ -175,7 +176,15 @@ virLogHandlerNew(bool privileged,
|
||||
handler->inhibitor = inhibitor;
|
||||
handler->opaque = opaque;
|
||||
|
||||
if (virLogCleanerInit(handler) < 0) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
return handler;
|
||||
|
||||
error:
|
||||
virObjectUnref(handler);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -313,6 +322,8 @@ virLogHandlerDispose(void *obj)
|
||||
virLogHandler *handler = obj;
|
||||
size_t i;
|
||||
|
||||
virLogCleanerShutdown(handler);
|
||||
|
||||
for (i = 0; i < handler->nfiles; i++) {
|
||||
handler->inhibitor(false, handler->opaque);
|
||||
virLogHandlerLogFileFree(handler->files[i]);
|
||||
|
Loading…
Reference in New Issue
Block a user