summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectLog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands/CommandObjectLog.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectLog.cpp38
1 files changed, 18 insertions, 20 deletions
diff --git a/lldb/source/Commands/CommandObjectLog.cpp b/lldb/source/Commands/CommandObjectLog.cpp
index 56630c9068c..f814dd2e3b4 100644
--- a/lldb/source/Commands/CommandObjectLog.cpp
+++ b/lldb/source/Commands/CommandObjectLog.cpp
@@ -291,31 +291,29 @@ public:
}
else
{
- for (size_t i=0; i<argc; ++i)
- {
- Log::Callbacks log_callbacks;
+ Log::Callbacks log_callbacks;
- std::string channel(args.GetArgumentAtIndex(i));
- if (Log::GetLogChannelCallbacks (channel.c_str(), log_callbacks))
+ std::string channel(args.GetArgumentAtIndex(0));
+ args.Shift (); // Shift off the channel
+ if (Log::GetLogChannelCallbacks (channel.c_str(), log_callbacks))
+ {
+ log_callbacks.disable (args, &result.GetErrorStream());
+ result.SetStatus(eReturnStatusSuccessFinishNoResult);
+ }
+ else if (channel == "all")
+ {
+ Log::DisableAllLogChannels(&result.GetErrorStream());
+ }
+ else
+ {
+ LogChannelSP log_channel_sp (GetLogChannelPluginForChannel(channel.c_str()));
+ if (log_channel_sp)
{
- log_callbacks.disable ();
+ log_channel_sp->Disable(args, &result.GetErrorStream());
result.SetStatus(eReturnStatusSuccessFinishNoResult);
}
- else if (channel == "all")
- {
- Log::DisableAllLogChannels();
- }
else
- {
- LogChannelSP log_channel_sp (GetLogChannelPluginForChannel(channel.c_str()));
- if (log_channel_sp)
- {
- log_channel_sp->Disable();
- result.SetStatus(eReturnStatusSuccessFinishNoResult);
- }
- else
- result.AppendErrorWithFormat("Invalid log channel '%s'.\n", args.GetArgumentAtIndex(0));
- }
+ result.AppendErrorWithFormat("Invalid log channel '%s'.\n", args.GetArgumentAtIndex(0));
}
}
return result.Succeeded();
OpenPOWER on IntegriCloud