src: added optional indexer AST logging

* removed old AstVisitor
* added new implementation called CxxAstVisitor
* added CxxVerboseAstVisitor that may wrap the CxxAstVisitor to log the AST while visiting
* added the same structure for the Java visitors
* removed all the logs that were fired when recording stuff
* Added UI setting for verbose indexer logging.
* implemented AST name obfuscation for Java and Cxx
* unified test visitors for Java and Cxx
* implemented recording using directive decl
* removed most of the old onXxxParsed methods
This commit is contained in:
malte_langkabel
2016-11-01 10:37:30 +01:00
parent a4240def56
commit 9e4a02a33a
36 changed files with 2145 additions and 3208 deletions
+1
View File
@@ -106,6 +106,7 @@ void FileLogger::logMessage(const std::string& type, const LogMessage& message)
std::ofstream fileStream;
fileStream.open(m_logDirectory + m_currentLogFileName, std::ios::app);
fileStream << message.getTimeString("%H:%M:%S") << " | ";
fileStream << message.threadId << " | ";
if (message.filePath.size())
{
@@ -70,7 +70,7 @@ void LogManagerImplementation::logInfo(
std::lock_guard<std::mutex> lockGuardLogger(m_loggerMutex);
for (unsigned int i = 0; i < m_loggers.size(); i++)
{
m_loggers[i]->onInfo(LogMessage(message, file, function, line, getTime()));
m_loggers[i]->onInfo(LogMessage(message, file, function, line, getTime(), std::this_thread::get_id()));
}
}
@@ -84,7 +84,7 @@ void LogManagerImplementation::logWarning(
std::lock_guard<std::mutex> lockGuardLogger(m_loggerMutex);
for (unsigned int i = 0; i < m_loggers.size(); i++)
{
m_loggers[i]->onWarning(LogMessage(message, file, function, line, getTime()));
m_loggers[i]->onWarning(LogMessage(message, file, function, line, getTime(), std::this_thread::get_id()));
}
}
@@ -98,7 +98,7 @@ void LogManagerImplementation::logError(
std::lock_guard<std::mutex> lockGuardLogger(m_loggerMutex);
for (unsigned int i = 0; i < m_loggers.size(); i++)
{
m_loggers[i]->onError(LogMessage(message, file, function, line, getTime()));
m_loggers[i]->onError(LogMessage(message, file, function, line, getTime(), std::this_thread::get_id()));
}
}
+5 -1
View File
@@ -3,6 +3,7 @@
#include <ctime>
#include <string>
#include <thread>
struct LogMessage
{
@@ -12,13 +13,15 @@ public:
const std::string& filePath,
const std::string& functionName,
const unsigned int line,
const std::tm& time
const std::tm& time,
const std::thread::id& threadId
)
: message(message)
, filePath(filePath)
, functionName(functionName)
, line(line)
, time(time)
, threadId(threadId)
{}
std::string getTimeString(const std::string& format) const
@@ -38,6 +41,7 @@ public:
const std::string functionName;
const unsigned int line;
const std::tm time;
const std::thread::id threadId;
};
#endif // LOG_MESSAGE_H
+18
View File
@@ -65,4 +65,22 @@
} \
while(0)
#define LOG_WARNING_STREAM_BARE(__s__) \
do \
{ \
std::stringstream __ss__; \
__ss__ __s__; \
LogManager::getInstance()->logWarning(__ss__.str(), "", "", 0); \
} \
while(0)
#define LOG_ERROR_STREAM_BARE(__s__) \
do \
{ \
std::stringstream __ss__; \
__ss__ __s__; \
LogManager::getInstance()->logError(__ss__.str(), "", "", 0); \
} \
while(0)
#endif // LOGGING_H