From a17da2550fe786708656a2aa9fd172f84ff6d06d Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Tue, 8 Oct 2013 18:06:50 +0200 Subject: journald: Adapt to recent global logging changes --- src/journald/CMakeLists.txt | 1 + ...alLogRecordInstanceCreationIndicationProvider.c | 2 +- src/journald/LMI_JournalLogRecordProvider.c | 2 +- src/journald/LMI_JournalMessageLogProvider.c | 2 +- src/journald/LMI_JournalRecordInLogProvider.c | 2 +- src/journald/journal.c | 26 ++++++++++++++++++++++ src/journald/journal.h | 4 ++++ 7 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 src/journald/journal.c (limited to 'src') diff --git a/src/journald/CMakeLists.txt b/src/journald/CMakeLists.txt index f524c5b..8e3b8b9 100644 --- a/src/journald/CMakeLists.txt +++ b/src/journald/CMakeLists.txt @@ -8,6 +8,7 @@ set(CIMPROVAGT_SCRIPT cmpiLMI_${PROVIDER_NAME}-cimprovagt) set(provider_SRCS instutil.c + journal.c ) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") diff --git a/src/journald/LMI_JournalLogRecordInstanceCreationIndicationProvider.c b/src/journald/LMI_JournalLogRecordInstanceCreationIndicationProvider.c index af68527..83daf63 100644 --- a/src/journald/LMI_JournalLogRecordInstanceCreationIndicationProvider.c +++ b/src/journald/LMI_JournalLogRecordInstanceCreationIndicationProvider.c @@ -33,7 +33,7 @@ static IMError im_err = IM_ERR_OK; static void LMI_JournalLogRecordInstanceCreationIndicationInitialize() { - lmi_init_logging(JOURNAL_CIM_LOG_NAME, _cb); + lmi_init(JOURNAL_CIM_LOG_NAME, _cb, provider_config_defaults); im = im_create_manager(ind_gather, ind_filter_cb, false, ind_watcher, IM_IND_CREATION, _cb, &im_err); } diff --git a/src/journald/LMI_JournalLogRecordProvider.c b/src/journald/LMI_JournalLogRecordProvider.c index 03493b3..1c51e00 100644 --- a/src/journald/LMI_JournalLogRecordProvider.c +++ b/src/journald/LMI_JournalLogRecordProvider.c @@ -43,7 +43,7 @@ static void LMI_JournalLogRecordInitialize() sd_journal *journal; int r; - lmi_init_logging(JOURNAL_CIM_LOG_NAME, _cb); + lmi_init(JOURNAL_CIM_LOG_NAME, _cb, provider_config_defaults); r = sd_journal_open(&journal, 0); if (r < 0) { diff --git a/src/journald/LMI_JournalMessageLogProvider.c b/src/journald/LMI_JournalMessageLogProvider.c index cde9a33..94ae200 100644 --- a/src/journald/LMI_JournalMessageLogProvider.c +++ b/src/journald/LMI_JournalMessageLogProvider.c @@ -38,7 +38,7 @@ static const CMPIBroker* _cb = NULL; static void LMI_JournalMessageLogInitialize() { - lmi_init_logging(JOURNAL_CIM_LOG_NAME, _cb); + lmi_init(JOURNAL_CIM_LOG_NAME, _cb, provider_config_defaults); } static CMPIStatus LMI_JournalMessageLogCleanup( diff --git a/src/journald/LMI_JournalRecordInLogProvider.c b/src/journald/LMI_JournalRecordInLogProvider.c index a0046bf..c22116f 100644 --- a/src/journald/LMI_JournalRecordInLogProvider.c +++ b/src/journald/LMI_JournalRecordInLogProvider.c @@ -31,7 +31,7 @@ static const CMPIBroker* _cb; static void LMI_JournalRecordInLogInitialize() { - lmi_init_logging(JOURNAL_CIM_LOG_NAME, _cb); + lmi_init(JOURNAL_CIM_LOG_NAME, _cb, provider_config_defaults); } static CMPIStatus LMI_JournalRecordInLogCleanup( diff --git a/src/journald/journal.c b/src/journald/journal.c new file mode 100644 index 0000000..2131855 --- /dev/null +++ b/src/journald/journal.c @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2013 Red Hat, Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Authors: Tomas Bzatek + */ + +#include +#include "journal.h" + + +const ConfigEntry *provider_config_defaults = NULL; + diff --git a/src/journald/journal.h b/src/journald/journal.h index b0365ca..bdd6d61 100644 --- a/src/journald/journal.h +++ b/src/journald/journal.h @@ -21,6 +21,7 @@ #ifndef JOURNAL_H_ #define JOURNAL_H_ +#include #define JOURNAL_MESSAGE_LOG_NAME "Journal" #define JOURNAL_CIM_LOG_NAME "openlmi-journald" /* prefix used in debug messages */ @@ -35,4 +36,7 @@ #define JOURNAL_MAX_INSTANCES_NUM 1000 /* Set to 0 to disable this feature */ +/* Logging setup */ +const ConfigEntry *provider_config_defaults; + #endif /* JOURNAL_H_ */ -- cgit