lldb-private-log.h revision b0fff359652c7b3c0eb6fb6c37995e61e6cc652d
1//===-- lldb-private-log.h --------------------------------------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_lldb_log_h_
11#define liblldb_lldb_log_h_
12
13// C Includes
14// C++ Includes
15// Other libraries and framework includes
16// Project includes
17#include "lldb/lldb-private.h"
18
19//----------------------------------------------------------------------
20// Log Bits specific to logging in lldb
21//----------------------------------------------------------------------
22#define LIBLLDB_LOG_VERBOSE             (1u << 0)
23#define LIBLLDB_LOG_PROCESS             (1u << 1)
24#define LIBLLDB_LOG_THREAD              (1u << 2)
25#define LIBLLDB_LOG_SHLIB               (1u << 3)
26#define LIBLLDB_LOG_EVENTS              (1u << 4)
27#define LIBLLDB_LOG_BREAKPOINTS         (1u << 5)
28#define LIBLLDB_LOG_WATCHPOINTS         (1u << 6)
29#define LIBLLDB_LOG_STEP                (1u << 7)
30#define LIBLLDB_LOG_EXPRESSIONS         (1u << 8)
31#define LIBLLDB_LOG_TEMPORARY           (1u << 9)
32#define LIBLLDB_LOG_STATE               (1u << 10)
33#define LIBLLDB_LOG_OBJECT              (1u << 11)
34#define LIBLLDB_LOG_COMMUNICATION       (1u << 12)
35#define LIBLLDB_LOG_CONNECTION          (1u << 13)
36#define LIBLLDB_LOG_HOST                (1u << 14)
37#define LIBLLDB_LOG_ALL                 (UINT32_MAX)
38#define LIBLLDB_LOG_DEFAULT             (LIBLLDB_LOG_PROCESS     |\
39                                         LIBLLDB_LOG_THREAD      |\
40                                         LIBLLDB_LOG_SHLIB       |\
41                                         LIBLLDB_LOG_BREAKPOINTS |\
42                                         LIBLLDB_LOG_WATCHPOINTS |\
43                                         LIBLLDB_LOG_STEP        |\
44                                         LIBLLDB_LOG_STATE       )
45
46namespace lldb_private {
47
48uint32_t
49GetLogMask ();
50
51void
52LogIfAllCategoriesSet (uint32_t mask, const char *format, ...);
53
54void
55LogIfAnyCategoriesSet (uint32_t mask, const char *format, ...);
56
57Log *
58GetLogIfAllCategoriesSet (uint32_t mask);
59
60Log *
61GetLogIfAnyCategoriesSet (uint32_t mask);
62
63uint32_t
64GetLogMask ();
65
66bool
67IsLogVerbose ();
68
69void
70DisableLog ();
71
72Log *
73EnableLog (lldb::StreamSP &log_stream_sp, uint32_t log_options, Args &args, Stream *feedback_strm);
74
75void
76ListLogCategories (Stream *strm);
77
78} // namespace lldb_private
79
80#endif  // liblldb_lldb_log_h_
81