Skip to content
Snippets Groups Projects
user avatar
Nat Goodspeed authored
The comments within indra/test/test.cpp promise that --debug is, in fact, like
LOGTEST=DEBUG. Until now, that was a lie. LOGTEST=level displayed log output
on stderr as well as in testprogram.log, while --debug did not.

Add LLError::logToStderr() function, and make initForApplication() (i.e.
commonInit()) call that instead of instantiating RecordToStderr inline. Also
call it when test.cpp recognizes --debug switch.

Remove the mFileRecorder, mFixedBufferRecorder and mFileRecorderFileName
members from SettingsConfig. That tactic doesn't scale.

Instead, add findRecorder<RECORDER>() and removeRecorder<RECORDER>() template
functions to locate (or remove) a RecorderPtr to an object of the specified
subclass. Both are based on an underlying findRecorderPos<RECORDER>() template
function. Since we never expect to manage more than a handful of RecorderPtrs,
and since access to the deleted members is very much application setup rather
than any kind of ongoing access, a search loop suffices.

logToFile() uses removeRecorder<RecordToFile>() rather than removing
mFileRecorder (the only use of mFileRecorder).

logToFixedBuffer() uses removeRecorder<RecordToFixedBuffer>() rather than
removing mFixedBufferRecorder (the only use of mFixedBufferRecorder).

Make RecordToFile store the filename with which it was instantiated. Add a
getFilename() method to retrieve it. logFileName() is now based on
findRecorder<RecordToFile>() instead of mFileRecorderFileName (the only use of
mFileRecorderFileName).

Make RecordToStderr::mUseANSI a simple bool rather than a three-state enum,
and set it immediately on construction. Apparently the reason it was set
lazily was because it consults its own checkANSI() method, and of course
'this' doesn't acquire the leaf class type until the constructor has completed
successfully. But since nothing in checkANSI() depends on anything else in
RecordToStderr, making it static solves that problem.
6b70493d
History
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Name Last commit Last update
..
tests
CMakeLists.txt
StackWalker.cpp
StackWalker.h
ctype_workaround.h
fix_macros.h
indra_constants.cpp
indra_constants.h
is_approx_equal_fraction.h
linden_common.h
llalignedarray.h
llallocator.cpp
llallocator.h
llallocator_heap_profile.cpp
llallocator_heap_profile.h
llapp.cpp
llapp.h
llapr.cpp
llapr.h
llassettype.cpp
llassettype.h
llatomic.cpp
llatomic.h
llbase32.cpp
llbase32.h
llbase64.cpp
llbase64.h
llbitpack.cpp
llbitpack.h
llboost.h
llcallbacklist.cpp
llcallbacklist.h
llcallstack.cpp
llcallstack.h
llcleanup.cpp
llcleanup.h
llclickaction.h
llcommon.cpp
llcommon.h
llcommonutils.cpp
llcommonutils.h
llcond.h
llcoros.cpp
llcoros.h
llcrc.cpp
llcrc.h
llcriticaldamp.cpp
llcriticaldamp.h
lldate.cpp
lldate.h
lldeadmantimer.cpp
lldeadmantimer.h
lldefs.h
lldependencies.cpp
lldependencies.h
lldepthstack.h
lldictionary.cpp
lldictionary.h
lldoubledispatch.h
llendianswizzle.h
llerror.cpp
llerror.h
llerrorcontrol.h
llerrorlegacy.h
llerrorthread.cpp
llerrorthread.h
llevent.cpp
llevent.h
lleventapi.cpp
lleventapi.h
lleventcoro.cpp
lleventcoro.h
lleventdispatcher.cpp
lleventdispatcher.h
lleventemitter.h
lleventfilter.cpp
lleventfilter.h
llevents.cpp
llevents.h
lleventtimer.cpp
lleventtimer.h
llexception.cpp
llexception.h
llfasttimer.cpp
llfasttimer.h
llfile.cpp
llfile.h
llfindlocale.cpp
llfindlocale.h
llfixedbuffer.cpp
llfixedbuffer.h
llformat.cpp
llformat.h
llframetimer.cpp
llframetimer.h
llhandle.h
llhash.h
llheartbeat.cpp
llheartbeat.h
llheteromap.cpp