diff --git a/code/nel/tools/3d/build_interface/main.cpp b/code/nel/tools/3d/build_interface/main.cpp
index 20465c57f..9150f6b66 100644
--- a/code/nel/tools/3d/build_interface/main.cpp
+++ b/code/nel/tools/3d/build_interface/main.cpp
@@ -14,10 +14,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see .
-// lightmap_optimizer
-// ------------------
-// the goal is to regroup lightmap of a level into lightmap with a higher level
-
#include "nel/misc/common.h"
#include "nel/misc/file.h"
#include "nel/misc/bitmap.h"
@@ -273,6 +269,9 @@ int main(int nNbArg, char **ppArgs)
{
try
{
+ ToolLogger.writeDepend(tgaName, AllMapNames[i]); // Write depend before error can occur.
+ ToolLogger.writeDepend(uvName, AllMapNames[i]);
+
NLMISC::CBitmap *pBtmp = new NLMISC::CBitmap;
NLMISC::CIFile inFile;
inFile.open( AllMapNames[i] );
@@ -430,6 +429,10 @@ int main(int nNbArg, char **ppArgs)
// Load existing uv file
CIFile iFile;
string filename = CPath::lookup (existingUVfilename, false);
+
+ ToolLogger.writeDepend(tgaName, existingUVfilename); // Write depend before error can occur.
+ ToolLogger.writeDepend(uvName, existingUVfilename);
+
if( (filename == "") || (!iFile.open(filename)) )
{
outString (string("ERROR : could not open file ") + existingUVfilename + "\n");
diff --git a/code/nel/tools/pipeline/pipeline_service/tool_logger.h b/code/nel/tools/pipeline/pipeline_service/tool_logger.h
index bdad16589..26b159e3e 100644
--- a/code/nel/tools/pipeline/pipeline_service/tool_logger.h
+++ b/code/nel/tools/pipeline/pipeline_service/tool_logger.h
@@ -34,11 +34,15 @@
// NeL includes
#include
+#include
// Project includes
namespace PIPELINE {
+#ifdef ERROR
+#undef ERROR
+#endif
enum EError
{
ERROR,
@@ -105,11 +109,31 @@ public:
{
if (m_ErrorLog)
{
- // TODO_ERROR_LOG
+ switch (type)
+ {
+ case ERROR:
+ fwrite("ERROR", 1, 5, m_ErrorLog);
+ break;
+ case WARNING:
+ fwrite("WARNING", 1, 7, m_ErrorLog);
+ break;
+ case MESSAGE:
+ fwrite("MESSAGE", 1, 7, m_ErrorLog);
+ break;
+ }
+ fwrite("\t", 1, 1, m_ErrorLog);
+ fwrite(path.c_str(), 1, path.length(), m_ErrorLog);
+ fwrite("\t", 1, 1, m_ErrorLog);
+ std::string time = NLMISC::toString(NLMISC::CTime::getSecondsSince1970());
+ fwrite(time.c_str(), 1, time.length(), m_ErrorLog);
+ fwrite("\t", 1, 1, m_ErrorLog);
+ fwrite(error.c_str(), 1, error.length(), m_ErrorLog);
+ fwrite("\n", 1, 1, m_ErrorLog);
+ fflush(m_ErrorLog);
}
}
- /// inputFile can only be file. May be not-yet-existing file for expected input. Directories are handled on process level.
+ /// inputFile can only be file. May be not-yet-existing file for expected input. Directories are handled on process level. You should call this before calling writeError on inputFile, so the error is also linked from the outputFile.
void writeDepend(const std::string &outputFile, const std::string &inputFile)
{
if (m_DependLog)