diff options
author | Lutz Bichler <Lutz.Bichler@bmw.de> | 2020-10-27 10:02:03 +0100 |
---|---|---|
committer | Lutz Bichler <Lutz.Bichler@bmw.de> | 2020-10-27 10:02:03 +0100 |
commit | 89720d3c63bbd22cbccc80cdc92c2f2dd20193ba (patch) | |
tree | 591c45dba85c98fdd8e141827bdb6e82aaad4f59 /include/CommonAPI/LoggerImpl.hpp | |
parent | 99ebf3461f51e4899f06457d6aafdaa4adecd278 (diff) | |
download | genivi-common-api-runtime-89720d3c63bbd22cbccc80cdc92c2f2dd20193ba.tar.gz |
Diffstat (limited to 'include/CommonAPI/LoggerImpl.hpp')
-rw-r--r-- | include/CommonAPI/LoggerImpl.hpp | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/include/CommonAPI/LoggerImpl.hpp b/include/CommonAPI/LoggerImpl.hpp deleted file mode 100644 index 1c69d87..0000000 --- a/include/CommonAPI/LoggerImpl.hpp +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (C) 2015-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 COMMONAPI_LOGGER_IMPL_HPP_ -#define COMMONAPI_LOGGER_IMPL_HPP_ - -#ifdef USE_DLT -#include <dlt/dlt.h> -#endif - -#include <cstdint> -#include <fstream> -#include <memory> -#include <mutex> -#include <sstream> - -#include <CommonAPI/Export.hpp> - - -namespace CommonAPI { - -class Logger; - -class LoggerImpl { -public: - friend class Logger; - - enum class Level : uint8_t COMMONAPI_EXPORT { - LL_FATAL = 0, LL_ERROR = 1, LL_WARNING = 2, LL_INFO = 3, LL_DEBUG = 4, LL_VERBOSE = 5 - }; - - static void init(bool, const std::string &, bool, const std::string &); - -private: - - LoggerImpl(); - ~LoggerImpl(); - - COMMONAPI_EXPORT static bool isLogged(Level _level); - - COMMONAPI_EXPORT static LoggerImpl* get(); - - COMMONAPI_EXPORT void doLog(Level _level, const std::string &_message); - -#if defined(USE_CONSOLE) || defined(USE_FILE) || defined(USE_DLT) - static Level stringAsLevel(const std::string &_level); -#endif -#if defined(USE_CONSOLE) || defined(USE_FILE) - static std::string levelAsString(Level _level); -#endif -#ifdef USE_DLT - static DltLogLevelType levelAsDlt(Level _level); -#endif -#if defined(USE_CONSOLE) || defined(USE_FILE) - static std::mutex mutex_; -#endif -#if defined(USE_CONSOLE) || defined(USE_FILE) || defined(USE_DLT) - static Level maximumLogLevel_; -#endif -#ifdef USE_CONSOLE - static bool useConsole_; -#endif -#ifdef USE_FILE - static std::shared_ptr<std::ofstream> file_; -#endif -#ifdef USE_DLT - static bool useDlt_; - DLT_DECLARE_CONTEXT(dlt_); - bool ownAppID_; -#endif -}; - -} // namespace CommonAPI - -#endif // COMMONAPI_LOGGER_IMPL_HPP_ |