diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2021-05-12 09:46:49 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2021-05-12 09:46:49 -0400 |
commit | 147c66d67ce83778fc3f102dd132ec095e6032fc (patch) | |
tree | aa712fd2ca95e3bfd22d8ae862a84551a90a075e /indra/newview/skins/default | |
parent | c9fc4349b7d4ab1f5a7bfc0125014a96a07e51a3 (diff) |
SL-10297: Simplify implementation of LLSingletonBase::logwarns() etc.
Introduce 'string_params' typedef for std::initialization_list<std::string>,
and make logwarns(), loginfos(), logdebugs() and logerrs() accept const
string_params&.
Eliminate the central log() function in llsingleton.cpp that used LL_VLOGS().
To cache the result of a (moderately expensive) Log::shouldLog() call,
LL_VLOGS() wants its CallSite object to be static -- but of course the
shouldLog() result will differ for different ELevel values, so LL_VLOGS()
instantiates a static array of CallSite instances. It seems silly to funnel
distinct logwarns(), etc., functions through a common log() function only to
have LL_VLOGS() tease apart ELevel values again. Instead, make logwarns()
directly invoke LL_WARNS(), and similarly for the rest.
To reduce boilerplate in these distinct functions, teach std::ostream how to
stream a string_params instance by looping over its elements. Then each
logwarns(), etc., function can simply stream its string_params argument to
LL_WARNS() or whichever.
In particular, eliminate the LLERROR_CRASH macro in logerrs(). The fact that
it invokes LL_ERRS() ensures that its LL_ENDL macro will crash the viewer.
Diffstat (limited to 'indra/newview/skins/default')
0 files changed, 0 insertions, 0 deletions