diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 52b37bb05cd70ad05d927dac5420c7923fb0515c..1ed25a0d176b749e31bd1d8289b5e56d83f3c9fc 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -277,7 +277,7 @@ namespace } LLError::configure(configuration); - llwarns << "error logging reconfigured from " << filename() << llendl; + llinfos << "logging reconfigured from " << filename() << llendl; } diff --git a/indra/llcommon/llliveappconfig.cpp b/indra/llcommon/llliveappconfig.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8bcaeb898f1e9840c95e86d200987478d225811c --- /dev/null +++ b/indra/llcommon/llliveappconfig.cpp @@ -0,0 +1,46 @@ +/** + * @file llliveappconfig.cpp + * @brief Configuration information for an LLApp that overrides indra.xml + * + * Copyright (c) 2003-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#include "linden_common.h" + +#include "llliveappconfig.h" + +#include "llapp.h" +#include "llsd.h" +#include "llsdserialize.h" + +LLLiveAppConfig::LLLiveAppConfig(LLApp* app, const std::string& filename, F32 refresh_period) +: LLLiveFile(filename, refresh_period), + mApp(app) +{ } + + +LLLiveAppConfig::~LLLiveAppConfig() +{ } + +// virtual +void LLLiveAppConfig::loadFile() +{ + llinfos << "LLLiveAppConfig::loadFile(): reading from " + << filename() << llendl; + llifstream file(filename().c_str()); + LLSD config; + if (file.is_open()) + { + LLSDSerialize::fromXML(config, file); + if(!config.isMap()) + { + llinfos << "LLDataserverConfig::loadFile(): not an map!" + << " Ignoring the data." << llendl; + return; + } + file.close(); + } + mApp->setOptionData( + LLApp::PRIORITY_SPECIFIC_CONFIGURATION, config); +} diff --git a/indra/llcommon/llliveappconfig.h b/indra/llcommon/llliveappconfig.h new file mode 100644 index 0000000000000000000000000000000000000000..ceceda5b180a416a5c757ff340e08972ce77376e --- /dev/null +++ b/indra/llcommon/llliveappconfig.h @@ -0,0 +1,33 @@ +/** + * @file llliveappconfig.h + * @brief Configuration information for an LLApp that overrides indra.xml + * + * Copyright (c) 2003-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#ifndef LLLIVEAPPCONFIG_H +#define LLLIVEAPPCONFIG_H + +#include "lllivefile.h" + +class LLApp; + +class LLLiveAppConfig : public LLLiveFile +{ +public: + // To use this, instantiate a LLLiveAppConfig object inside your main loop. + // The traditional name for it is live_config. + // Be sure to call live_config.checkAndReload() periodically. + + LLLiveAppConfig(LLApp* app, const std::string& filename, F32 refresh_period); + ~LLLiveAppConfig(); + +protected: + /*virtual*/ void loadFile(); + +private: + LLApp* mApp; +}; + +#endif