summaryrefslogtreecommitdiff
path: root/implementation/logger/include/logger_impl.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'implementation/logger/include/logger_impl.hpp')
-rw-r--r--implementation/logger/include/logger_impl.hpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/implementation/logger/include/logger_impl.hpp b/implementation/logger/include/logger_impl.hpp
new file mode 100644
index 0000000..bb83363
--- /dev/null
+++ b/implementation/logger/include/logger_impl.hpp
@@ -0,0 +1,53 @@
+// Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#ifndef VSOMEIP_V3_LOGGER_CONFIGURATION_HPP_
+#define VSOMEIP_V3_LOGGER_CONFIGURATION_HPP_
+
+#include <memory>
+#include <mutex>
+
+#ifdef USE_DLT
+#include <dlt/dlt.h>
+#endif
+
+#include <vsomeip/internal/logger.hpp>
+
+namespace vsomeip_v3 {
+
+class configuration;
+
+namespace logger {
+
+class logger_impl {
+public:
+ VSOMEIP_IMPORT_EXPORT static void init(const std::shared_ptr<configuration> &_configuration);
+ static std::shared_ptr<logger_impl> get();
+
+ logger_impl() = default;
+ ~logger_impl();
+
+ std::shared_ptr<configuration> get_configuration() const;
+
+#ifdef USE_DLT
+ void log(level_e _level, const char *_data);
+
+private:
+ void enable_dlt(const std::string &_application, const std::string &_context);
+#endif
+
+private:
+ static std::mutex mutex__;
+ std::shared_ptr<configuration> configuration_;
+
+#ifdef USE_DLT
+ DLT_DECLARE_CONTEXT(dlt_);
+#endif
+};
+
+} // namespace logger
+} // namespace vsomeip_v3
+
+#endif // VSOMEIP_V3_LOGGER_CONFIGURATION_HPP_