From fdb547159d53b4dfc1c394a39d0455201dd8bd0a Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 17 Jul 2010 18:30:02 +0200 Subject: [PATCH] Changed: #991 Make sure all debug files are created in log directory --- .../tools/sheets_packer/sheets_packer.cpp | 1 - .../tools/sheets_packer/sheets_packer.vcproj | 10 +--- .../sheets_packer/sheets_packer_init.cpp | 34 +++++++++---- .../tools/sheets_packer/sheets_packer_init.h | 2 + .../sheets_packer/sheets_packer_release.cpp | 49 ------------------- .../sheets_packer/sheets_packer_release.h | 33 ------------- 6 files changed, 28 insertions(+), 101 deletions(-) delete mode 100644 code/ryzom/tools/sheets_packer/sheets_packer_release.cpp delete mode 100644 code/ryzom/tools/sheets_packer/sheets_packer_release.h diff --git a/code/ryzom/tools/sheets_packer/sheets_packer.cpp b/code/ryzom/tools/sheets_packer/sheets_packer.cpp index e7f6388b3..83fc43173 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer.cpp +++ b/code/ryzom/tools/sheets_packer/sheets_packer.cpp @@ -35,7 +35,6 @@ // Client #include "sheets_packer_init.h" -#include "sheets_packer_release.h" /////////// diff --git a/code/ryzom/tools/sheets_packer/sheets_packer.vcproj b/code/ryzom/tools/sheets_packer/sheets_packer.vcproj index 9ae25c46f..798fafe68 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer.vcproj +++ b/code/ryzom/tools/sheets_packer/sheets_packer.vcproj @@ -1,7 +1,7 @@ - - - - diff --git a/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp b/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp index 906e86e7d..f429aa634 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp +++ b/code/ryzom/tools/sheets_packer/sheets_packer_init.cpp @@ -30,8 +30,6 @@ #include "nel/ligo/ligo_config.h" #include "nel/ligo/primitive.h" -// 3D Interface. -//#include "nel/3d/u_driver.h" // Application #include "sheets_packer_init.h" #include "sheets_packer_cfg.h" @@ -50,8 +48,7 @@ using namespace std; ///////////// // GLOBALS // ///////////// -//UDriver *Driver = 0; -CFileDisplayer fd("sheets_packer.log", true, "SHEETS_PACKER.LOG"); +CFileDisplayer *fd = NULL; NLLIGO::CLigoConfig LigoConfig; @@ -68,14 +65,16 @@ bool init() // Add a displayer for Debug Infos. createDebug(); + fd = new CFileDisplayer(getLogDirectory() + "sheets_packer.log", true, "SHEETS_PACKER.LOG"); + // register ligo 'standard' class NLLIGO::Register(); - DebugLog->addDisplayer (&fd); - InfoLog->addDisplayer (&fd); - WarningLog->addDisplayer (&fd); - ErrorLog->addDisplayer (&fd); - AssertLog->addDisplayer (&fd); + DebugLog->addDisplayer (fd); + InfoLog->addDisplayer (fd); + WarningLog->addDisplayer (fd); + ErrorLog->addDisplayer (fd); + AssertLog->addDisplayer (fd); // Load the application configuration. nlinfo("Loading config file..."); @@ -104,6 +103,23 @@ bool init() // The init is a success. return true; }// init // + +//--------------------------------------------------- +// release : +// Release all the memory. +//--------------------------------------------------- +void release() +{ + DebugLog->removeDisplayer ("SHEETS_PACKER.LOG"); + InfoLog->removeDisplayer ("SHEETS_PACKER.LOG"); + WarningLog->removeDisplayer ("SHEETS_PACKER.LOG"); + ErrorLog->removeDisplayer ("SHEETS_PACKER.LOG"); + AssertLog->removeDisplayer ("SHEETS_PACKER.LOG"); + + delete fd; + fd = NULL; +}// release // + void outputSomeDebugInfoForPackedSheetCrash() { } diff --git a/code/ryzom/tools/sheets_packer/sheets_packer_init.h b/code/ryzom/tools/sheets_packer/sheets_packer_init.h index 1bdcd4e94..26c476a7c 100644 --- a/code/ryzom/tools/sheets_packer/sheets_packer_init.h +++ b/code/ryzom/tools/sheets_packer/sheets_packer_init.h @@ -27,6 +27,8 @@ // Initialize the application. bool init(); +// Release all. +void release(); #endif // TL_SHEETS_PACKER_INIT_H diff --git a/code/ryzom/tools/sheets_packer/sheets_packer_release.cpp b/code/ryzom/tools/sheets_packer/sheets_packer_release.cpp deleted file mode 100644 index 1f08c1cc4..000000000 --- a/code/ryzom/tools/sheets_packer/sheets_packer_release.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - - - -///////////// -// INCLUDE // -///////////// -#include "stdpch.h" -#include "sheets_packer_release.h" - -#include "nel/misc/debug.h" - - -/////////// -// USING // -/////////// -using namespace NLMISC; - - -/////////////// -// FUNCTIONS // -/////////////// -//--------------------------------------------------- -// release : -// Release all the memory. -//--------------------------------------------------- -void release() -{ - DebugLog->removeDisplayer ("SHEETS_PACKER.LOG"); - InfoLog->removeDisplayer ("SHEETS_PACKER.LOG"); - WarningLog->removeDisplayer ("SHEETS_PACKER.LOG"); - ErrorLog->removeDisplayer ("SHEETS_PACKER.LOG"); - AssertLog->removeDisplayer ("SHEETS_PACKER.LOG"); -}// release // diff --git a/code/ryzom/tools/sheets_packer/sheets_packer_release.h b/code/ryzom/tools/sheets_packer/sheets_packer_release.h deleted file mode 100644 index 0ac0cf7be..000000000 --- a/code/ryzom/tools/sheets_packer/sheets_packer_release.h +++ /dev/null @@ -1,33 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - - -#ifndef TL_SHEETS_PACKER_RELEASE_H -#define TL_SHEETS_PACKER_RELEASE_H - -#include "nel/misc/types_nl.h" - - - -// Release all. -void release(); - - - -#endif // TL_SHEETS_PACKER_RELEASE_H - -/* End of sheets_packer_release.h */