From 8a3aa3f6cac3da0ee962dac211580a7987a4fc31 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 23 Dec 2011 12:06:36 -0500 Subject: STORM-1790 Provide a Develop sub-menu to change the default logging level co-authored with Zi Ree --- indra/llcommon/llerror.cpp | 6 +++ indra/llcommon/llerrorcontrol.h | 1 + indra/newview/llviewermenu.cpp | 27 +++++++++++ indra/newview/skins/default/xui/en/menu_login.xml | 53 +++++++++++++++++++++- indra/newview/skins/default/xui/en/menu_viewer.xml | 51 +++++++++++++++++++++ 5 files changed, 137 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index c35799bbb9..e4381dbbd6 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -617,6 +617,12 @@ namespace LLError s.defaultLevel = level; } + ELevel getDefaultLevel() + { + Settings& s = Settings::get(); + return s.defaultLevel; + } + void setFunctionLevel(const std::string& function_name, ELevel level) { Globals& g = Globals::get(); diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h index fb75d45e2c..ed9de002f5 100644 --- a/indra/llcommon/llerrorcontrol.h +++ b/indra/llcommon/llerrorcontrol.h @@ -75,6 +75,7 @@ namespace LLError LL_COMMON_API void setPrintLocation(bool); LL_COMMON_API void setDefaultLevel(LLError::ELevel); + LL_COMMON_API ELevel getDefaultLevel(); LL_COMMON_API void setFunctionLevel(const std::string& function_name, LLError::ELevel); LL_COMMON_API void setClassLevel(const std::string& class_name, LLError::ELevel); LL_COMMON_API void setFileLevel(const std::string& file_name, LLError::ELevel); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 3a1b8d7623..0104d35e53 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2203,6 +2203,30 @@ class LLAdvancedEnableToggleHackedGodmode : public view_listener_t //// Advanced menu ////------------------------------------------------------------------- + +////////////////// +// DEVELOP MENU // +////////////////// + +class LLDevelopCheckLoggingLevel : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + U32 level = userdata.asInteger(); + return (static_cast(level) == LLError::getDefaultLevel()); + } +}; + +class LLDevelopSetLoggingLevel : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + U32 level = userdata.asInteger(); + LLError::setDefaultLevel(static_cast(level)); + return true; + } +}; + ////////////////// // ADMIN MENU // ////////////////// @@ -8195,6 +8219,9 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedRequestAdminStatus(), "Advanced.RequestAdminStatus"); view_listener_t::addMenu(new LLAdvancedLeaveAdminStatus(), "Advanced.LeaveAdminStatus"); + // Develop >Set logging level + view_listener_t::addMenu(new LLDevelopCheckLoggingLevel(), "Develop.CheckLoggingLevel"); + view_listener_t::addMenu(new LLDevelopSetLoggingLevel(), "Develop.SetLoggingLevel"); // Admin >Object view_listener_t::addMenu(new LLAdminForceTakeCopy(), "Admin.ForceTakeCopy"); diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml index 8ac1ac9e09..101e104eab 100644 --- a/indra/newview/skins/default/xui/en/menu_login.xml +++ b/indra/newview/skins/default/xui/en/menu_login.xml @@ -174,7 +174,58 @@ function="Advanced.WebContentTest" parameter="http://google.com"/> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3