1 | /* |
2 | * Copyright (C) 2003-2017 Apple Inc. All rights reserved. |
3 | * |
4 | * Redistribution and use in source and binary forms, with or without |
5 | * modification, are permitted provided that the following conditions |
6 | * are met: |
7 | * 1. Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. |
9 | * 2. Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. |
12 | * |
13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY |
14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR |
17 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
18 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
19 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
20 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
21 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 | */ |
25 | |
26 | #pragma once |
27 | |
28 | #include <pal/LogMacros.h> |
29 | #include <wtf/Assertions.h> |
30 | #include <wtf/Forward.h> |
31 | |
32 | namespace WebCore { |
33 | |
34 | #if !LOG_DISABLED || !RELEASE_LOG_DISABLED |
35 | |
36 | #ifndef LOG_CHANNEL_PREFIX |
37 | #define LOG_CHANNEL_PREFIX Log |
38 | #endif |
39 | |
40 | #define WEBCORE_LOG_CHANNELS(M) \ |
41 | M(AdClickAttribution) \ |
42 | M(Animations) \ |
43 | M(ApplePay) \ |
44 | M(Archives) \ |
45 | M(ClipRects) \ |
46 | M(Compositing) \ |
47 | M(CompositingOverlap) \ |
48 | M(ContentFiltering) \ |
49 | M(ContentObservation) \ |
50 | M(DatabaseTracker) \ |
51 | M(DisplayLists) \ |
52 | M(DOMTimers) \ |
53 | M(Editing) \ |
54 | M(EME) \ |
55 | M(Events) \ |
56 | M(FileAPI) \ |
57 | M(Filters) \ |
58 | M(Fonts) \ |
59 | M(Frames) \ |
60 | M(FTP) \ |
61 | M(Fullscreen) \ |
62 | M(Gamepad) \ |
63 | M(History) \ |
64 | M(IOSurface) \ |
65 | M(IconDatabase) \ |
66 | M(Images) \ |
67 | M(IndexedDB) \ |
68 | M(IndexedDBOperations) \ |
69 | M(Layers) \ |
70 | M(Layout) \ |
71 | M(FormattingContextLayout) \ |
72 | M(Loading) \ |
73 | M(Media) \ |
74 | M(MediaCaptureSamples) \ |
75 | M(MediaQueries) \ |
76 | M(MediaSource) \ |
77 | M(MediaStream) \ |
78 | M(MediaSourceSamples) \ |
79 | M(MemoryPressure) \ |
80 | M(MessagePorts) \ |
81 | M(Network) \ |
82 | M(NotYetImplemented) \ |
83 | M(PageCache) \ |
84 | M(PerformanceLogging) \ |
85 | M(PlatformLeaks) \ |
86 | M(Plugins) \ |
87 | M(PopupBlocking) \ |
88 | M(Progress) \ |
89 | M(RemoteInspector) \ |
90 | M(RequestAnimationFrame) \ |
91 | M(ResourceLoading) \ |
92 | M(ResourceLoadObserver) \ |
93 | M(ResourceLoadStatistics) \ |
94 | M(Scrolling) \ |
95 | M(Services) \ |
96 | M(ServiceWorker) \ |
97 | M(SpellingAndGrammar) \ |
98 | M(SQLDatabase) \ |
99 | M(StorageAPI) \ |
100 | M(SVG) \ |
101 | M(TextAutosizing) \ |
102 | M(Tiling) \ |
103 | M(Threading) \ |
104 | M(URLParser) \ |
105 | M(Viewports) \ |
106 | M(WebAudio) \ |
107 | M(WebGL) \ |
108 | M(WebGPU) \ |
109 | M(WebRTC) \ |
110 | M(WebRTCStats) \ |
111 | M(WheelEventTestTriggers) \ |
112 | |
113 | #undef DECLARE_LOG_CHANNEL |
114 | #define DECLARE_LOG_CHANNEL(name) \ |
115 | WEBCORE_EXPORT extern WTFLogChannel JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, name); |
116 | |
117 | WEBCORE_LOG_CHANNELS(DECLARE_LOG_CHANNEL) |
118 | |
119 | String logLevelString(); |
120 | bool isLogChannelEnabled(const String& name); |
121 | WEBCORE_EXPORT void setLogChannelToAccumulate(const String& name); |
122 | |
123 | #endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED |
124 | |
125 | WEBCORE_EXPORT WTFLogChannel* getLogChannel(const String& name); |
126 | |
127 | } // namespace WebCore |
128 | |