From 35f256d0597e55c6e2680ca612871c9b457a572a Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Wed, 16 Feb 2011 13:20:04 +0100 Subject: use logcontrol.xml also for SLPlugin --- linden/indra/llplugin/slplugin/slplugin.cpp | 39 ++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'linden/indra/llplugin/slplugin') diff --git a/linden/indra/llplugin/slplugin/slplugin.cpp b/linden/indra/llplugin/slplugin/slplugin.cpp index 09331ca..347f1de 100755 --- a/linden/indra/llplugin/slplugin/slplugin.cpp +++ b/linden/indra/llplugin/slplugin/slplugin.cpp @@ -54,6 +54,20 @@ #include #endif +//imprudence: or we include lldir, or use apache runtime +//though the one is probably bloat and the other we rather want to avoid +#include // FILENAME_MAX +#ifdef WINDOWS + #include + #define getImpruDir _getcwd + #define DIR_DELIMITER "\\" +#else + #include + #define getImpruDir getcwd + #define DIR_DELIMITER "/" +#endif + + /* On Mac OS, since we call WaitNextEvent, this process will show up in the dock unless we set the LSBackgroundOnly or LSUIElement flag in the Info.plist. @@ -188,9 +202,28 @@ int main(int argc, char **argv) { // Set up llerror logging { - LLError::initForApplication("."); - LLError::setDefaultLevel(LLError::LEVEL_INFO); -// LLError::setTagLevel("Plugin", LLError::LEVEL_DEBUG); + std::string path; + char impruPath[FILENAME_MAX]; + + if (!getImpruDir(impruPath, sizeof(impruPath))) + { + path = "."; //FIXME: root directory of the system - bad idea + } + else + { + path = std::string(impruPath); + + path.append(DIR_DELIMITER); + path.append("app_settings"); + } + LLError::initForApplication(path); +// LLError::setDefaultLevel(LLError::LEVEL_INFO); +// LLError::setPrintLocation(true); +// LLError::setTagLevel("Plugin", LLError::LEVEL_DEBUG); +// LLError::setTagLevel("PluginPipe", LLError::LEVEL_DEBUG); +// LLError::setTagLevel("PluginChild", LLError::LEVEL_DEBUG); +// LLError::setTagLevel("PluginInstance", LLError::LEVEL_DEBUG); + // LLError::logToFile("slplugin.log"); } -- cgit v1.1