summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/linearstore/JournalLogImpl.cpp
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2013-10-22 19:09:56 +0000
committerKim van der Riet <kpvdr@apache.org>2013-10-22 19:09:56 +0000
commit10450e2bc10d56fe3696bc5284e0ec77c63647ee (patch)
treecd676b8ad920aca643a149cde3397688c4bd1964 /cpp/src/qpid/linearstore/JournalLogImpl.cpp
parentf7cbe401aa405da618e39e9e77aa95d9375d23eb (diff)
downloadqpid-python-10450e2bc10d56fe3696bc5284e0ec77c63647ee.tar.gz
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
Diffstat (limited to 'cpp/src/qpid/linearstore/JournalLogImpl.cpp')
-rw-r--r--cpp/src/qpid/linearstore/JournalLogImpl.cpp59
1 files changed, 59 insertions, 0 deletions
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