2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Contact: Lukasz Kostyra <l.kostyra@samsung.com>
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License
21 * @author Lukasz Kostyra (l.kostyra@samsung.com)
22 * @brief Scope logger class declaration
25 #ifndef COMMON_LOGGER_LOGGER_SCOPE_HPP
26 #define COMMON_LOGGER_LOGGER_SCOPE_HPP
36 operator std::string() const;
39 SStreamWrapper& operator<<(const T& b)
46 std::ostringstream mSStream;
50 * Class specifically for scope debug logging. Should be used at the beggining of a scope.
51 * Constructor marks scope enterance, destructor marks scope leave.
56 LoggerScope(const std::string& file,
57 const unsigned int line,
58 const std::string& func,
59 const std::string& message,
60 const std::string& rootDir);
64 const std::string mFile;
65 const unsigned int mLine;
66 const std::string mFunc;
67 const std::string mMessage;
68 const std::string mRootDir;
74 * @brief Automatically create LoggerScope object which logs at the construction and destruction
77 #define LOGS(MSG) logger::LoggerScope logScopeObj(__FILE__, __LINE__, __func__, \
78 logger::SStreamWrapper() << MSG, \
81 #endif // COMMON_LOGGER_LOGGER_SCOPE_HPP