9 #include "fwCore/log/SpyLogger.hpp" 10 #include "fwCore/log/ScopedMessage.hpp" 23 ScopedMessage::ScopedMessage(
const char * _file,
int _line, std::string enterMessage, std::string leaveMessage)
24 : m_file(_file), m_line(_line), m_leave(leaveMessage.empty() ? enterMessage : leaveMessage)
26 std::stringstream base;
27 base <<
"Timed{'file':'"<< m_file <<
"','line':"<< m_line <<
",";
28 m_baseMsg = base.str();
30 std::stringstream oslStr;
31 oslStr <<
"[ENTERING SCOPE] "<< m_baseMsg <<
"'entermessage':'" << enterMessage <<
"'}";
32 ::fwCore::log::SpyLogger::getSpyLogger().trace(oslStr.str(), m_file, m_line);
38 ScopedMessage::~ScopedMessage()
40 std::stringstream oslStr;
41 oslStr <<
"[LEAVING SCOPE] "<< m_baseMsg <<
"'leavemessage':'" << m_leave <<
"','elapsed':"<<
42 m_timer.getElapsedTimeInMilliSec() <<
"}";
43 SpyLogger::getSpyLogger().trace(oslStr.str(), m_file, m_line);
This namespace fwCore provides common foundations for FW4SPL.