Added: #1440 Placeholder error logging code

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent 7292685545
commit b53c2aad26

@ -50,8 +50,10 @@ namespace PIPELINE {
void CFileError::serial(NLMISC::IStream &stream) throw (NLMISC::EStream) void CFileError::serial(NLMISC::IStream &stream) throw (NLMISC::EStream)
{ {
uint version = stream.serialVersion(1); uint version = stream.serialVersion(1);
stream.serial((uint8 &)MasterTime); // does this work?
stream.serial(Project); stream.serial(Project);
stream.serial(Process); stream.serial(Plugin);
stream.serial(Time);
stream.serial(Message); stream.serial(Message);
} }

@ -33,6 +33,7 @@
// NeL includes // NeL includes
#include <vector> #include <vector>
#include <nel/misc/tool_logger.h>
// Project includes // Project includes
#include "workspace_storage.h" #include "workspace_storage.h"
@ -76,11 +77,11 @@ public:
struct CFileError struct CFileError
{ {
public: public:
uint32 Time; // The time when this error occured. uint32 MasterTime; // The time when this error occured.
// TFileState Level; // Success, Warning, Error, Removal TError Level;
std::string Project; std::string Project;
std::string Process; std::string Plugin;
// std::string Plugin; std::string Time;
std::string Message; std::string Message;
void serial(NLMISC::IStream &stream) throw (NLMISC::EStream); void serial(NLMISC::IStream &stream) throw (NLMISC::EStream);
@ -180,6 +181,9 @@ public:
// static void createRemove(const CFileRemove &remove, const std::string &path); // Remove cannot be modified after creation, only erased. // static void createRemove(const CFileRemove &remove, const std::string &path); // Remove cannot be modified after creation, only erased.
// static void eraseRemove(const std::string &path); // static void eraseRemove(const std::string &path);
static std::string getErrorPath(const std::string &file) { return "[TODO]"; }
static void appendError(const CFileError &error, const std::string &metaPath) { /* TODO */ }
static std::string getDependPath(const std::string &file); static std::string getDependPath(const std::string &file);
static bool readDepend(CFileDepend &depend, const std::string &metaPath); static bool readDepend(CFileDepend &depend, const std::string &metaPath);
static void writeDepend(const CFileDepend &depend, const std::string &metaPath); static void writeDepend(const CFileDepend &depend, const std::string &metaPath);

@ -513,6 +513,16 @@ public:
if (slaveIt == m_Slaves.end()) { nlerror("Received 'slaveLoggedToolError' from unknown slave at '%s'", sender->getModuleName().c_str()); m_Slaves.erase(sender); /*m_SlavesMutex.unlock();*/ return; } if (slaveIt == m_Slaves.end()) { nlerror("Received 'slaveLoggedToolError' from unknown slave at '%s'", sender->getModuleName().c_str()); m_Slaves.erase(sender); /*m_SlavesMutex.unlock();*/ return; }
CSlave *slave = slaveIt->second; CSlave *slave = slaveIt->second;
// TODO
CFileError fe;
fe.MasterTime = CTime::getSecondsSince1970();
fe.Level = (TError)type;
fe.Message = error;
fe.Time = time;
fe.Project = "[TODO:PROJECT]";
fe.Plugin = "[TODO:PLUGIN]";
CMetadataStorage::appendError(fe, CMetadataStorage::getErrorPath(unMacroPath(macroPath)));
notifyTerminalTaskMessage(slave->ActiveTaskId, (TError)type, macroPath, time, error); notifyTerminalTaskMessage(slave->ActiveTaskId, (TError)type, macroPath, time, error);
} }

Loading…
Cancel
Save