diff options
| author | Jim Ingham <jingham@apple.com> | 2012-02-21 02:23:08 +0000 |
|---|---|---|
| committer | Jim Ingham <jingham@apple.com> | 2012-02-21 02:23:08 +0000 |
| commit | 228063cd21c4e13aba0ef7a4522b1f32e3116c18 (patch) | |
| tree | 73697c5ec27b8e8f282974db7db4f18de99b770b /lldb/source/lldb-log.cpp | |
| parent | 926410d2db727c5093bda792cb8b2025d7f02cc3 (diff) | |
| download | bcm5719-llvm-228063cd21c4e13aba0ef7a4522b1f32e3116c18.tar.gz bcm5719-llvm-228063cd21c4e13aba0ef7a4522b1f32e3116c18.zip | |
Add a logging mode that takes a callback and flush'es to that callback.
Also add SB API's to set this callback, and to enable the log channels.
llvm-svn: 151018
Diffstat (limited to 'lldb/source/lldb-log.cpp')
| -rw-r--r-- | lldb/source/lldb-log.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lldb/source/lldb-log.cpp b/lldb/source/lldb-log.cpp index b02dd25d5f1..4080bd8303b 100644 --- a/lldb/source/lldb-log.cpp +++ b/lldb/source/lldb-log.cpp @@ -98,20 +98,19 @@ lldb_private::GetLogIfAnyCategoriesSet (uint32_t mask) } void -lldb_private::DisableLog (Args &args, Stream *feedback_strm) +lldb_private::DisableLog (const char **categories, Stream *feedback_strm) { LogSP log(GetLog ()); if (log) { uint32_t flag_bits = 0; - const size_t argc = args.GetArgumentCount (); - if (argc > 0) + if (categories[0] != NULL) { flag_bits = log->GetMask().Get(); - for (size_t i = 0; i < argc; ++i) + for (size_t i = 0; categories[i] != NULL; ++i) { - const char *arg = args.GetArgumentAtIndex (i); + const char *arg = categories[i]; if (0 == ::strcasecmp(arg, "all")) flag_bits &= ~LIBLLDB_LOG_ALL; else if (0 == ::strcasecmp(arg, "api")) flag_bits &= ~LIBLLDB_LOG_API; @@ -155,7 +154,7 @@ lldb_private::DisableLog (Args &args, Stream *feedback_strm) } LogSP -lldb_private::EnableLog (StreamSP &log_stream_sp, uint32_t log_options, Args &args, Stream *feedback_strm) +lldb_private::EnableLog (StreamSP &log_stream_sp, uint32_t log_options, const char **categories, Stream *feedback_strm) { // Try see if there already is a log - that way we can reuse its settings. // We could reuse the log in toto, but we don't know that the stream is the same. @@ -176,10 +175,9 @@ lldb_private::EnableLog (StreamSP &log_stream_sp, uint32_t log_options, Args &ar if (log) { bool got_unknown_category = false; - const size_t argc = args.GetArgumentCount(); - for (size_t i=0; i<argc; ++i) + for (size_t i=0; categories[i] != NULL; ++i) { - const char *arg = args.GetArgumentAtIndex(i); + const char *arg = categories[i]; if (0 == ::strcasecmp(arg, "all")) flag_bits |= LIBLLDB_LOG_ALL; else if (0 == ::strcasecmp(arg, "api")) flag_bits |= LIBLLDB_LOG_API; |

