Changed: #991 Make sure all debug files are created in log directory

This commit is contained in:
kervala 2010-07-17 18:30:02 +02:00
parent bbc814e12b
commit c1606111a8
6 changed files with 28 additions and 101 deletions

View file

@ -35,7 +35,6 @@
// Client
#include "sheets_packer_init.h"
#include "sheets_packer_release.h"
///////////

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Version="9,00"
Name="sheets_packer"
ProjectGUID="{079E2366-3714-4B09-B553-41A44D290F04}"
TargetFrameworkVersion="0"
@ -426,14 +426,6 @@
RelativePath=".\sheets_packer_init.h"
>
</File>
<File
RelativePath=".\sheets_packer_release.cpp"
>
</File>
<File
RelativePath=".\sheets_packer_release.h"
>
</File>
<File
RelativePath=".\stdpch.cpp"
>

View file

@ -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()
{
}

View file

@ -27,6 +27,8 @@
// Initialize the application.
bool init();
// Release all.
void release();
#endif // TL_SHEETS_PACKER_INIT_H

View file

@ -1,49 +0,0 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// 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 <http://www.gnu.org/licenses/>.
/////////////
// 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 //

View file

@ -1,33 +0,0 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// 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 <http://www.gnu.org/licenses/>.
#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 */