From b53c2aad265a170dd424c80c2caeb6c4d6a46cf7 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 7 Aug 2012 19:34:39 +0200 Subject: [PATCH] Added: #1440 Placeholder error logging code --HG-- branch : build_pipeline_v3 --- code/nel/tools/pipeline/service/metadata_storage.cpp | 4 +++- code/nel/tools/pipeline/service/metadata_storage.h | 12 ++++++++---- .../pipeline/service/module_pipeline_master.cpp | 10 ++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/code/nel/tools/pipeline/service/metadata_storage.cpp b/code/nel/tools/pipeline/service/metadata_storage.cpp index 80fd20399..cf467f363 100644 --- a/code/nel/tools/pipeline/service/metadata_storage.cpp +++ b/code/nel/tools/pipeline/service/metadata_storage.cpp @@ -50,8 +50,10 @@ namespace PIPELINE { void CFileError::serial(NLMISC::IStream &stream) throw (NLMISC::EStream) { uint version = stream.serialVersion(1); + stream.serial((uint8 &)MasterTime); // does this work? stream.serial(Project); - stream.serial(Process); + stream.serial(Plugin); + stream.serial(Time); stream.serial(Message); } diff --git a/code/nel/tools/pipeline/service/metadata_storage.h b/code/nel/tools/pipeline/service/metadata_storage.h index 205db4508..d41c53b86 100644 --- a/code/nel/tools/pipeline/service/metadata_storage.h +++ b/code/nel/tools/pipeline/service/metadata_storage.h @@ -33,6 +33,7 @@ // NeL includes #include +#include // Project includes #include "workspace_storage.h" @@ -76,11 +77,11 @@ public: struct CFileError { public: - uint32 Time; // The time when this error occured. - // TFileState Level; // Success, Warning, Error, Removal + uint32 MasterTime; // The time when this error occured. + TError Level; std::string Project; - std::string Process; - // std::string Plugin; + std::string Plugin; + std::string Time; std::string Message; 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 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 bool readDepend(CFileDepend &depend, const std::string &metaPath); static void writeDepend(const CFileDepend &depend, const std::string &metaPath); diff --git a/code/nel/tools/pipeline/service/module_pipeline_master.cpp b/code/nel/tools/pipeline/service/module_pipeline_master.cpp index 90f9feb6b..429738b13 100644 --- a/code/nel/tools/pipeline/service/module_pipeline_master.cpp +++ b/code/nel/tools/pipeline/service/module_pipeline_master.cpp @@ -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; } 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); }