Fixed webadmin logging.

This fixes #262.
master
madmaxoft 2013-10-18 12:50:35 +02:00
parent 8bba2b02a1
commit e6bb025a9f
3 changed files with 17 additions and 3 deletions

View File

@ -140,7 +140,6 @@ void cRoot::Start(void)
} }
IniFile.WriteFile(); IniFile.WriteFile();
LOG("Initialising WebAdmin...");
m_WebAdmin = new cWebAdmin(); m_WebAdmin = new cWebAdmin();
m_WebAdmin->Init(); m_WebAdmin->Init();
@ -172,7 +171,6 @@ void cRoot::Start(void)
LOGD("Finalising startup..."); LOGD("Finalising startup...");
m_Server->Start(); m_Server->Start();
LOG("Starting WebAdmin...");
m_WebAdmin->Start(); m_WebAdmin->Start();
#if !defined(ANDROID_NDK) #if !defined(ANDROID_NDK)
@ -210,7 +208,6 @@ void cRoot::Start(void)
LOGD("Freeing MonsterConfig..."); LOGD("Freeing MonsterConfig...");
delete m_MonsterConfig; m_MonsterConfig = NULL; delete m_MonsterConfig; m_MonsterConfig = NULL;
LOGD("Stopping WebAdmin...");
delete m_WebAdmin; m_WebAdmin = NULL; delete m_WebAdmin; m_WebAdmin = NULL;
LOGD("Unloading recipes..."); LOGD("Unloading recipes...");
delete m_FurnaceRecipe; m_FurnaceRecipe = NULL; delete m_FurnaceRecipe; m_FurnaceRecipe = NULL;

View File

@ -53,6 +53,18 @@ cWebAdmin::cWebAdmin(void) :
cWebAdmin::~cWebAdmin()
{
if (m_IsInitialized)
{
LOG("Stopping WebAdmin...");
}
}
void cWebAdmin::AddPlugin( cWebPlugin * a_Plugin ) void cWebAdmin::AddPlugin( cWebPlugin * a_Plugin )
{ {
m_Plugins.remove( a_Plugin ); m_Plugins.remove( a_Plugin );
@ -79,6 +91,8 @@ bool cWebAdmin::Init(void)
return false; return false;
} }
LOG("Initialising WebAdmin...");
if (!m_IniFile.GetValueSetB("WebAdmin", "Enabled", true)) if (!m_IniFile.GetValueSetB("WebAdmin", "Enabled", true))
{ {
// WebAdmin is disabled, bail out faking a success // WebAdmin is disabled, bail out faking a success
@ -108,6 +122,8 @@ bool cWebAdmin::Start(void)
return false; return false;
} }
LOG("Starting WebAdmin...");
// Initialize the WebAdmin template script and load the file // Initialize the WebAdmin template script and load the file
m_TemplateScript.Create(); m_TemplateScript.Create();
if (!m_TemplateScript.LoadFile(FILE_IO_PREFIX "webadmin/template.lua")) if (!m_TemplateScript.LoadFile(FILE_IO_PREFIX "webadmin/template.lua"))

View File

@ -106,6 +106,7 @@ public:
cWebAdmin(void); cWebAdmin(void);
~cWebAdmin();
/// Initializes the object. Returns true if successfully initialized and ready to start /// Initializes the object. Returns true if successfully initialized and ready to start
bool Init(void); bool Init(void);