|
| 1 | +/*----------------------------------------------------------------------------------------------- |
| 2 | +The MIT License (MIT) |
| 3 | +
|
| 4 | +Copyright (c) 2014-2025 Kim Kulling |
| 5 | +
|
| 6 | +Permission is hereby granted, free of charge, to any person obtaining a copy of |
| 7 | +this software and associated documentation files (the "Software"), to deal in |
| 8 | +the Software without restriction, including without limitation the rights to |
| 9 | +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
| 10 | +the Software, and to permit persons to whom the Software is furnished to do so, |
| 11 | +subject to the following conditions: |
| 12 | +
|
| 13 | +The above copyright notice and this permission notice shall be included in all |
| 14 | +copies or substantial portions of the Software. |
| 15 | +
|
| 16 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| 18 | +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| 19 | +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| 20 | +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 21 | +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 22 | +-----------------------------------------------------------------------------------------------*/ |
1 | 23 | #pragma once
|
2 | 24 |
|
3 | 25 | #include <cppcore/CPPCoreCommon.h>
|
@@ -63,16 +85,20 @@ class Logger final {
|
63 | 85 | public:
|
64 | 86 | /// @brief Describes the verbode mode.
|
65 | 87 | enum class VerboseMode {
|
66 |
| - Normal, ///< Only warnings and errors will be logged. |
67 |
| - Verbose, ///< Normal messages will be logged as well. |
68 |
| - Debug, ///< All debug messages will be logged as well. |
69 |
| - Trace ///< Will enable the tracing. |
| 88 | + Invalid = -1, ///< Invalid marker |
| 89 | + Normal, ///< Only warnings and errors will be logged. |
| 90 | + Verbose, ///< Normal messages will be logged as well. |
| 91 | + Debug, ///< All debug messages will be logged as well. |
| 92 | + Trace, ///< Will enable the tracing. |
| 93 | + Count ///< Number of enums |
70 | 94 | };
|
71 | 95 |
|
72 | 96 | /// @brief Describes the mode for prints into the active log stream.
|
73 | 97 | enum class PrintMode {
|
| 98 | + Invalid = -1, ///< Invalid marker |
74 | 99 | WithDateTime, ///< A dateTime string will put be in front of the entry.
|
75 |
| - WhithoutDateTime ///< No DateTime will be there. |
| 100 | + WhithoutDateTime, ///< No DateTime will be there. |
| 101 | + Count ///< Number of enums |
76 | 102 | };
|
77 | 103 |
|
78 | 104 | public:
|
@@ -183,44 +209,44 @@ void fatalPrint( const String &domain, const String &file, int line, const Strin
|
183 | 209 | /// @param domain The domain to log for.
|
184 | 210 | /// @param message The message to log.
|
185 | 211 | //-------------------------------------------------------------------------------------------------
|
186 |
| -#define log_trace(domain, msg) cppcore::tracePrint(domain, __FILE__, __LINE__, msg) |
| 212 | +#define log_trace(domain, msg) ::cppcore::tracePrint(domain, __FILE__, __LINE__, msg) |
187 | 213 |
|
188 | 214 | //-------------------------------------------------------------------------------------------------
|
189 | 215 | /// @fn osre_debug
|
190 | 216 | /// @brief This helper macro will write the debug message into the logger.
|
191 | 217 | /// @param domain The domain to log for.
|
192 | 218 | /// @param message The message to log.
|
193 | 219 | //-------------------------------------------------------------------------------------------------
|
194 |
| -#define log_debug(domain, msg) cppcore::debugPrint( domain, __FILE__, __LINE__, msg) |
| 220 | +#define log_debug(domain, msg) ::cppcore::debugPrint(domain, __FILE__, __LINE__, msg) |
195 | 221 |
|
196 | 222 | //-------------------------------------------------------------------------------------------------
|
197 | 223 | /// @fn osre_log
|
198 | 224 | /// @brief This helper macro will write the info message into the logger.
|
199 | 225 | /// @param domain The domain to log for.
|
200 | 226 | /// @param message The message to log.
|
201 | 227 | //-------------------------------------------------------------------------------------------------
|
202 |
| -#define log_info(domain, msg) cppcore::infoPrint( domain, __FILE__, __LINE__, msg) |
| 228 | +#define log_info(domain, msg) ::cppcore::infoPrint(domain, __FILE__, __LINE__, msg) |
203 | 229 |
|
204 | 230 | //-------------------------------------------------------------------------------------------------
|
205 | 231 | /// @fn osre_warn
|
206 | 232 | /// @brief This helper macro will write a warning into the logger.
|
207 | 233 | /// @param domain The domain to log for.
|
208 | 234 | /// @param message The warning to writhe into the log.
|
209 | 235 | //-------------------------------------------------------------------------------------------------
|
210 |
| -#define log_warn(domain, message) cppcore::warnPrint( domain, __FILE__, __LINE__, message) |
| 236 | +#define log_warn(domain, message) ::cppcore::warnPrint(domain, __FILE__, __LINE__, message) |
211 | 237 |
|
212 | 238 | //-------------------------------------------------------------------------------------------------
|
213 | 239 | /// @fn osre_error
|
214 | 240 | /// @brief This helper macro will write a error into the logger.
|
215 | 241 | /// @param domain The domain to log for.
|
216 | 242 | /// @param message The warning to writhe into the log.
|
217 | 243 | //-------------------------------------------------------------------------------------------------
|
218 |
| -#define log_error(domain, message) cppcore::errorPrint( domain, __FILE__, __LINE__, message) |
| 244 | +#define log_error(domain, message) ::cppcore::errorPrint(domain, __FILE__, __LINE__, message) |
219 | 245 |
|
220 | 246 | //-------------------------------------------------------------------------------------------------
|
221 | 247 | /// @fn osre_fatal
|
222 | 248 | /// @brief This helper macro will write a fatal error into the logger.
|
223 | 249 | /// @param domain The domain to log for.
|
224 | 250 | /// @param message The warning to writhe into the log.
|
225 | 251 | //-------------------------------------------------------------------------------------------------
|
226 |
| -#define log_fatal( domain, message ) cppcore::fatalPrint( domain,__FILE__, __LINE__, message) |
| 252 | +#define log_fatal(domain, message) ::cppcore::fatalPrint(domain, __FILE__, __LINE__, message) |
0 commit comments