3333/* stl header */
3434#include < chrono>
3535#include < iomanip>
36+ #include < source_location.hpp>
3637#include < sstream>
3738#include < string>
3839#include < unordered_map>
@@ -56,19 +57,19 @@ namespace vx {
5657 };
5758
5859#if defined(LOGGINGALL) || defined(LOGGINGVERBOSE)
59- constexpr Severity avoidLogAbove = Severity::Verbose;
60+ constexpr Severity avoidLogBelow = Severity::Verbose;
6061#elif defined(LOGGINGDEBUG)
61- constexpr Severity avoidLogAbove = Severity::Debug;
62+ constexpr Severity avoidLogBelow = Severity::Debug;
6263#elif defined(LOGGINGWARNING)
63- constexpr Severity avoidLogAbove = Severity::Warning;
64+ constexpr Severity avoidLogBelow = Severity::Warning;
6465#elif defined(LOGGINGERROR)
65- constexpr Severity avoidLogAbove = Severity::Error;
66+ constexpr Severity avoidLogBelow = Severity::Error;
6667#elif defined(LOGGINGFATAL)
67- constexpr Severity avoidLogAbove = Severity::Fatal;
68+ constexpr Severity avoidLogBelow = Severity::Fatal;
6869#elif defined(LOGGINGNONE)
69- constexpr Severity avoidLogAbove = Severity::Fatal + 1 ;
70+ constexpr Severity avoidLogBelow = Severity::Fatal + 1 ;
7071#else
71- constexpr Severity avoidLogAbove = Severity::Info;
72+ constexpr Severity avoidLogBelow = Severity::Info;
7273#endif
7374
7475 /* *
@@ -84,9 +85,9 @@ namespace vx {
8485 const auto nowMs = std::chrono::duration_cast<std::chrono::microseconds>( now.time_since_epoch () ) % 1000000 ;
8586
8687#ifdef _WIN32
87- localtime_s (¤tLocalTime, &nowAsTimeT);
88+ localtime_s ( ¤tLocalTime, &nowAsTimeT );
8889#else
89- localtime_r (&nowAsTimeT, ¤tLocalTime);
90+ localtime_r ( &nowAsTimeT, ¤tLocalTime );
9091#endif
9192
9293 std::ostringstream nowSs;
@@ -100,16 +101,6 @@ namespace vx {
100101 return result;
101102 }
102103
103- // TODO: Currently not used
104- /* inline std::string threadId() {
105-
106- std::ostringstream s;
107- s << " [" << std::this_thread::get_id() << "]";
108- s.flush();
109- std::string result = s.str();
110- return result;
111- } */
112-
113104 /* *
114105 * @brief The Logger class.
115106 * @note Not pure virtual to use as /dev/null logger.
@@ -138,8 +129,11 @@ namespace vx {
138129 * @brief Build the log message.
139130 * @param _message Message to log.
140131 * @param _severity Severity level of the message.
132+ * @param _location Source location information.
141133 */
142- virtual void log ( const std::string &_message, const Severity _severity );
134+ virtual void log ( const std::string &_message,
135+ const Severity _severity,
136+ const nostd::source_location &_location = nostd::source_location::current() );
143137
144138 /* *
145139 * @brief Output the log message.
0 commit comments