1 /* 2 * Copyright (C) 2003, 2006 Apple Computer, 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 COMPUTER, 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 COMPUTER, 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 #include "config.h" 27 #include "Logging.h" 28 #include "PlatformString.h" 29 30 namespace WebCore { 31 32 WTFLogChannel LogNotYetImplemented = { 0x00000001, "WebCoreLogLevel", WTFLogChannelOff }; 33 34 WTFLogChannel LogFrames = { 0x00000010, "WebCoreLogLevel", WTFLogChannelOff }; 35 WTFLogChannel LogLoading = { 0x00000020, "WebCoreLogLevel", WTFLogChannelOff }; 36 37 WTFLogChannel LogPopupBlocking = { 0x00000040, "WebCoreLogLevel", WTFLogChannelOff }; 38 39 WTFLogChannel LogEvents = { 0x00000080, "WebCoreLogLevel", WTFLogChannelOff }; 40 WTFLogChannel LogEditing = { 0x00000100, "WebCoreLogLevel", WTFLogChannelOff }; 41 WTFLogChannel LogTextConversion = { 0x00000200, "WebCoreLogLevel", WTFLogChannelOff }; 42 43 WTFLogChannel LogIconDatabase = { 0x00000400, "WebCoreLogLevel", WTFLogChannelOff }; 44 WTFLogChannel LogSQLDatabase = { 0x00000800, "WebCoreLogLevel", WTFLogChannelOff }; 45 46 WTFLogChannel LogSpellingAndGrammar ={ 0x00001000, "WebCoreLogLevel", WTFLogChannelOff }; 47 WTFLogChannel LogBackForward = { 0x00002000, "WebCoreLogLevel", WTFLogChannelOff }; 48 WTFLogChannel LogHistory = { 0x00004000, "WebCoreLogLevel", WTFLogChannelOff }; 49 WTFLogChannel LogPageCache = { 0x00008000, "WebCoreLogLevel", WTFLogChannelOff }; 50 51 WTFLogChannel LogPlatformLeaks = { 0x00010000, "WebCoreLogLevel", WTFLogChannelOff }; 52 53 WTFLogChannel LogNetwork = { 0x00100000, "WebCoreLogLevel", WTFLogChannelOff }; 54 WTFLogChannel LogFTP = { 0x00200000, "WebCoreLogLevel", WTFLogChannelOff }; 55 WTFLogChannel LogThreading = { 0x00400000, "WebCoreLogLevel", WTFLogChannelOff }; 56 WTFLogChannel LogStorageAPI = { 0x00800000, "WebCoreLogLevel", WTFLogChannelOff }; 57 58 WTFLogChannel LogMedia = { 0x01000000, "WebCoreLogLevel", WTFLogChannelOff }; 59 60 WTFLogChannel LogPlugins = { 0x02000000, "WebCoreLogLevel", WTFLogChannelOff }; 61 WTFLogChannel LogArchives = { 0x04000000, "WebCoreLogLevel", WTFLogChannelOff }; 62 63 WTFLogChannel* getChannelFromName(const String& channelName) 64 { 65 if (!(channelName.length() >= 2)) 66 return 0; 67 68 if (equalIgnoringCase(channelName, String("BackForward"))) 69 return &LogBackForward; 70 71 if (equalIgnoringCase(channelName, String("Editing"))) 72 return &LogEditing; 73 74 if (equalIgnoringCase(channelName, String("Events"))) 75 return &LogEvents; 76 77 if (equalIgnoringCase(channelName, String("Frames"))) 78 return &LogFrames; 79 80 if (equalIgnoringCase(channelName, String("FTP"))) 81 return &LogFTP; 82 83 if (equalIgnoringCase(channelName, String("History"))) 84 return &LogHistory; 85 86 if (equalIgnoringCase(channelName, String("IconDatabase"))) 87 return &LogIconDatabase; 88 89 if (equalIgnoringCase(channelName, String("Loading"))) 90 return &LogLoading; 91 92 if (equalIgnoringCase(channelName, String("Media"))) 93 return &LogMedia; 94 95 if (equalIgnoringCase(channelName, String("Network"))) 96 return &LogNetwork; 97 98 if (equalIgnoringCase(channelName, String("NotYetImplemented"))) 99 return &LogNotYetImplemented; 100 101 if (equalIgnoringCase(channelName, String("PageCache"))) 102 return &LogPageCache; 103 104 if (equalIgnoringCase(channelName, String("PlatformLeaks"))) 105 return &LogPlatformLeaks; 106 107 if (equalIgnoringCase(channelName, String("Plugins"))) 108 return &LogPlugins; 109 110 if (equalIgnoringCase(channelName, String("PopupBlocking"))) 111 return &LogPopupBlocking; 112 113 if (equalIgnoringCase(channelName, String("SpellingAndGrammar"))) 114 return &LogSpellingAndGrammar; 115 116 if (equalIgnoringCase(channelName, String("SQLDatabase"))) 117 return &LogSQLDatabase; 118 119 if (equalIgnoringCase(channelName, String("StorageAPI"))) 120 return &LogStorageAPI; 121 122 if (equalIgnoringCase(channelName, String("TextConversion"))) 123 return &LogTextConversion; 124 125 if (equalIgnoringCase(channelName, String("Threading"))) 126 return &LogThreading; 127 128 return 0; 129 } 130 131 } 132