From 20ad3c40f4693d446ce69feda59a5e91ca0ea3a3 Mon Sep 17 00:00:00 2001 From: Caroline Tice Date: Fri, 29 Oct 2010 21:48:37 +0000 Subject: Add the ability to disable individual log categories, rather than just the entire log channel. Add checks, where appropriate, to make sure a log channel/category has not been disabled before attempting to write to it. llvm-svn: 117715 --- lldb/source/Commands/CommandObjectLog.cpp | 38 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'lldb/source/Commands/CommandObjectLog.cpp') 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; iDisable(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(); -- cgit v1.2.3