Is it possible to add some unittests for this? In addition to just tests=good, it would also serve as documentation for the new api<br><div class="gmail_quote"><div dir="ltr">On Mon, Feb 13, 2017 at 9:09 AM Pavel Labath via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">labath created this revision.<br class="gmail_msg">
Herald added a subscriber: aprantl.<br class="gmail_msg">
<br class="gmail_msg">
We currently have two log channel registration mechanisms. One uses a<br class="gmail_msg">
set of function pointers and the other one is based on the<br class="gmail_msg">
PluginManager.<br class="gmail_msg">
<br class="gmail_msg">
The PluginManager dependency is unfortunate, as logging<br class="gmail_msg">
is also used in lldb-server, and the PluginManager pulls in a lot of<br class="gmail_msg">
classes which are not used in lldb-server.<br class="gmail_msg">
<br class="gmail_msg">
Both approach have the problem that they leave too much to do for the<br class="gmail_msg">
user, and so the individual log channels end up reimplementing command<br class="gmail_msg">
line argument parsing, category listing, etc.<br class="gmail_msg">
<br class="gmail_msg">
Here, I replace the PluginManager-based approach with a one. The new API<br class="gmail_msg">
is more declarative, so the user only needs to specify the list of list<br class="gmail_msg">
of channels, their descriptions, etc., and all the common tasks like<br class="gmail_msg">
enabling/disabling categories are hadled by common code. I migrate the<br class="gmail_msg">
LogChannelDWARF (only user of the PluginManager method) to the new API.<br class="gmail_msg">
<br class="gmail_msg">
In the follow-up commits I'll replace the other channels with something<br class="gmail_msg">
similar.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D29895" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D29895</a><br class="gmail_msg">
<br class="gmail_msg">
Files:<br class="gmail_msg">
include/lldb/Core/Log.h<br class="gmail_msg">
include/lldb/Core/PluginManager.h<br class="gmail_msg">
include/lldb/lldb-forward.h<br class="gmail_msg">
include/lldb/lldb-private-interfaces.h<br class="gmail_msg">
source/Commands/CommandObjectLog.cpp<br class="gmail_msg">
source/Core/Log.cpp<br class="gmail_msg">
source/Core/PluginManager.cpp<br class="gmail_msg">
source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp<br class="gmail_msg">
source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h<br class="gmail_msg">
source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp<br class="gmail_msg">
unittests/Core/LogTest.cpp<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div>