From 10450e2bc10d56fe3696bc5284e0ec77c63647ee Mon Sep 17 00:00:00 2001 From: Kim van der Riet Date: Tue, 22 Oct 2013 19:09:56 +0000 Subject: QPID-4984: WIP: Copy of work over from branch to trunk. Non-tx works with some known bugs, tx not yet operational. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1534736 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/linearstore/JournalLogImpl.cpp | 59 +++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 cpp/src/qpid/linearstore/JournalLogImpl.cpp (limited to 'cpp/src/qpid/linearstore/JournalLogImpl.cpp') diff --git a/cpp/src/qpid/linearstore/JournalLogImpl.cpp b/cpp/src/qpid/linearstore/JournalLogImpl.cpp new file mode 100644 index 0000000000..b7935b1509 --- /dev/null +++ b/cpp/src/qpid/linearstore/JournalLogImpl.cpp @@ -0,0 +1,59 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +#include "qpid/linearstore/JournalLogImpl.h" + +namespace qpid { +namespace linearstore { + +JournalLogImpl::JournalLogImpl(const qpid::qls_jrnl::JournalLog::log_level_t logLevelThreshold) : qpid::qls_jrnl::JournalLog(logLevelThreshold) {} +JournalLogImpl::~JournalLogImpl() {} + +void +JournalLogImpl::log(const qpid::qls_jrnl::JournalLog::log_level_t level, + const std::string& log_stmt) const { + switch (level) { + case LOG_CRITICAL: QPID_LOG(critical, "Linear Store: " << log_stmt); break; + case LOG_ERROR: QPID_LOG(error, "Linear Store: " << log_stmt); break; + case LOG_WARN: QPID_LOG(warning, "Linear Store: " << log_stmt); break; + case LOG_NOTICE: QPID_LOG(notice, "Linear Store: " << log_stmt); break; + case LOG_INFO: QPID_LOG(info, "Linear Store: " << log_stmt); break; + case LOG_DEBUG: QPID_LOG(debug, "Linear Store: " << log_stmt); break; + default: QPID_LOG(trace, "Linear Store: " << log_stmt); + } +} + +void +JournalLogImpl::log(const qpid::qls_jrnl::JournalLog::log_level_t level, + const std::string& jid, + const std::string& log_stmt) const { + switch (level) { + case LOG_CRITICAL: QPID_LOG(critical, "Linear Store: Journal \'" << jid << "\":" << log_stmt); break; + case LOG_ERROR: QPID_LOG(error, "Linear Store: Journal \'" << jid << "\":" << log_stmt); break; + case LOG_WARN: QPID_LOG(warning, "Linear Store: Journal \'" << jid << "\":" << log_stmt); break; + case LOG_NOTICE: QPID_LOG(notice, "Linear Store: Journal \'" << jid << "\":" << log_stmt); break; + case LOG_INFO: QPID_LOG(info, "Linear Store: Journal \'" << jid << "\":" << log_stmt); break; + case LOG_DEBUG: QPID_LOG(debug, "Linear Store: Journal \'" << jid << "\":" << log_stmt); break; + default: QPID_LOG(trace, "Linear Store: Journal \'" << jid << "\":" << log_stmt); + } +} + +}} // namespace qpid::linearstore -- cgit v1.2.1