Skip to content
Permalink
Browse files
Simplify log channel configuration UI
https://bugs.webkit.org/show_bug.cgi?id=180527
<rdar://problem/35908382>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/Console.json:

Source/WebCore:

No new tests, updated existing test.

* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::getLoggingChannels):
(WebCore::channelConfigurationForString):

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Models/LoggingChannel.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):

LayoutTests:

* inspector/console/webcore-logging.html: Updated test for new results.


Canonical link: https://commits.webkit.org/196483@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225663 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eric-carlson committed Dec 8, 2017
1 parent 1574ee3 commit 72ad824a5af243775b3e1c0e2907b0791206a82a
@@ -1,3 +1,13 @@
2017-12-07 Eric Carlson <eric.carlson@apple.com>

Simplify log channel configuration UI
https://bugs.webkit.org/show_bug.cgi?id=180527
<rdar://problem/35908382>

Reviewed by Joseph Pecoraro.

* inspector/console/webcore-logging.html: Updated test for new results.

2017-12-07 Oleksandr Skachkov <gskachkov@gmail.com>

WebAssembly: sending module to iframe fails
@@ -126,15 +126,15 @@
let channel = WI.logManager.customLoggingChannels.find(channel => channel.source === WI.ConsoleMessage.MessageSource.Media);
InspectorTest.expectThat(channel.level === WI.LoggingChannel.Level.Off, "Media logging disabled.");

ConsoleAgent.setLoggingChannelLevel(channel.source, WI.LoggingChannel.Level.Log)
ConsoleAgent.setLoggingChannelLevel(channel.source, WI.LoggingChannel.Level.Basic)
ConsoleAgent.getLoggingChannels((error, channels) => {
if (error) {
InspectorTest.fail(`ConsoleAgent.getLoggingChannels() failed with error ${error}`);
reject();
}

let mediaChannel = channels.find(channel => channel.source === WI.ConsoleMessage.MessageSource.Media);
InspectorTest.expectThat(mediaChannel.level === WI.LoggingChannel.Level.Log, "Media logging has been enabled.");
InspectorTest.expectThat(mediaChannel.level === WI.LoggingChannel.Level.Basic, "Media logging has been enabled.");

let logListener = WI.logManager.addEventListener(WI.LogManager.Event.MessageAdded, (event) => {
let message = event.data.message;
@@ -1,3 +1,13 @@
2017-12-07 Eric Carlson <eric.carlson@apple.com>

Simplify log channel configuration UI
https://bugs.webkit.org/show_bug.cgi?id=180527
<rdar://problem/35908382>

Reviewed by Joseph Pecoraro.

* inspector/protocol/Console.json:

2017-12-07 Mark Lam <mark.lam@apple.com>

Apply poisoning to some native code pointers.
@@ -12,7 +12,7 @@
{
"id": "ChannelLevel",
"type": "string",
"enum": ["off", "log", "error", "warning", "info", "debug"],
"enum": ["off", "basic", "verbose"],
"description": "Level of logging."
},
{
@@ -1,3 +1,17 @@
2017-12-07 Eric Carlson <eric.carlson@apple.com>

Simplify log channel configuration UI
https://bugs.webkit.org/show_bug.cgi?id=180527
<rdar://problem/35908382>

Reviewed by Joseph Pecoraro.

No new tests, updated existing test.

* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::getLoggingChannels):
(WebCore::channelConfigurationForString):

2017-12-07 Yusuke Suzuki <utatane.tea@gmail.com>

Use StaticLock instead of NeverDestroyed<Lock>
@@ -66,23 +66,17 @@ void WebConsoleAgent::getLoggingChannels(ErrorString&, RefPtr<JSON::ArrayOf<Insp
if (!logChannel)
return;

Inspector::Protocol::Console::ChannelLevel level = Inspector::Protocol::Console::ChannelLevel::Off;
auto level = Inspector::Protocol::Console::ChannelLevel::Off;
if (logChannel->state != WTFLogChannelOff) {
switch (logChannel->level) {
case WTFLogLevelAlways:
level = Inspector::Protocol::Console::ChannelLevel::Log;
break;
case WTFLogLevelError:
level = Inspector::Protocol::Console::ChannelLevel::Error;
break;
case WTFLogLevelWarning:
level = Inspector::Protocol::Console::ChannelLevel::Warning;
level = Inspector::Protocol::Console::ChannelLevel::Basic;
break;
case WTFLogLevelInfo:
level = Inspector::Protocol::Console::ChannelLevel::Info;
break;
case WTFLogLevelDebug:
level = Inspector::Protocol::Console::ChannelLevel::Debug;
level = Inspector::Protocol::Console::ChannelLevel::Verbose;
break;
}
}
@@ -105,15 +99,9 @@ static std::optional<std::pair<WTFLogChannelState, WTFLogLevel>> channelConfigur
level = WTFLogLevelError;
} else {
state = WTFLogChannelOn;
if (equalIgnoringASCIICase(levelString, "log"))
level = WTFLogLevelAlways;
else if (equalIgnoringASCIICase(levelString, "error"))
level = WTFLogLevelError;
else if (equalIgnoringASCIICase(levelString, "warning"))
if (equalIgnoringASCIICase(levelString, "basic"))
level = WTFLogLevelWarning;
else if (equalIgnoringASCIICase(levelString, "info"))
level = WTFLogLevelInfo;
else if (equalIgnoringASCIICase(levelString, "debug"))
else if (equalIgnoringASCIICase(levelString, "verbose"))
level = WTFLogLevelDebug;
else
return std::nullopt;
@@ -1,3 +1,16 @@
2017-12-07 Eric Carlson <eric.carlson@apple.com>

Simplify log channel configuration UI
https://bugs.webkit.org/show_bug.cgi?id=180527
<rdar://problem/35908382>

Reviewed by Joseph Pecoraro.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Models/LoggingChannel.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):

2017-12-07 Matt Lewis <jlewis3@apple.com>

Unreviewed, rolling out r225634.
@@ -128,6 +128,7 @@ localizedStrings["Average Time"] = "Average Time";
localizedStrings["Back (%s)"] = "Back (%s)";
localizedStrings["Background"] = "Background";
localizedStrings["Backtrace"] = "Backtrace";
localizedStrings["Basic"] = "Basic";
localizedStrings["Basis"] = "Basis";
localizedStrings["Beacon"] = "Beacon";
localizedStrings["Beacons"] = "Beacons";
@@ -274,7 +275,6 @@ localizedStrings["Database"] = "Database";
localizedStrings["Database no longer has expected version."] = "Database no longer has expected version.";
localizedStrings["Databases"] = "Databases";
localizedStrings["Date"] = "Date";
localizedStrings["Debug"] = "Debug";
localizedStrings["Debug: "] = "Debug: ";
localizedStrings["Debugger"] = "Debugger";
localizedStrings["Debugger Paused"] = "Debugger Paused";
@@ -498,7 +498,6 @@ localizedStrings["Indent width:"] = "Indent width:";
localizedStrings["Index"] = "Index";
localizedStrings["Index Key \u2014 %s"] = "Index Key \u2014 %s";
localizedStrings["Indexed Databases"] = "Indexed Databases";
localizedStrings["Info"] = "Info";
localizedStrings["Info: "] = "Info: ";
localizedStrings["Infos"] = "Infos";
localizedStrings["Inherited From"] = "Inherited From";
@@ -556,7 +555,6 @@ localizedStrings["Local Storage"] = "Local Storage";
localizedStrings["Local Variables"] = "Local Variables";
localizedStrings["Located at %s"] = "Located at %s";
localizedStrings["Location"] = "Location";
localizedStrings["Log"] = "Log";
localizedStrings["Log Canvas Context"] = "Log Canvas Context";
localizedStrings["Log Element"] = "Log Element";
localizedStrings["Log Frame Text"] = "Log Frame Text";
@@ -1007,6 +1005,7 @@ localizedStrings["Using previous selector “%s”"] = "Using previous selector
localizedStrings["Value"] = "Value";
localizedStrings["Variables"] = "Variables";
localizedStrings["Variants"] = "Variants";
localizedStrings["Verbose"] = "Verbose";
localizedStrings["Version"] = "Version";
localizedStrings["Vertex"] = "Vertex";
localizedStrings["Vertex Shader"] = "Vertex Shader";
@@ -1019,7 +1018,6 @@ localizedStrings["Visible"] = "Visible";
localizedStrings["Waiting"] = "Waiting";
localizedStrings["Waiting for canvas contexts created by script or CSS."] = "Waiting for canvas contexts created by script or CSS.";
localizedStrings["Waiting for frames…"] = "Waiting for frames…";
localizedStrings["Warning"] = "Warning";
localizedStrings["Warning: "] = "Warning: ";
localizedStrings["Warnings"] = "Warnings";
localizedStrings["Watch Expressions"] = "Watch Expressions";
@@ -52,9 +52,6 @@ WI.LoggingChannel = class LoggingChannel

WI.LoggingChannel.Level = {
Off: "off",
Log: "log",
Error: "error",
Warning: "warning",
Info: "info",
Debug: "debug",
Basic: "basic",
Verbose: "verbose",
};
@@ -217,11 +217,8 @@ WI.SettingsTabContentView = class SettingsTabContentView extends WI.TabContentVi
if (WI.LogManager.supportsLogChannels()) {
const logLevels = [
[WI.LoggingChannel.Level.Off, WI.UIString("Off")],
[WI.LoggingChannel.Level.Log, WI.UIString("Log")],
[WI.LoggingChannel.Level.Error, WI.UIString("Error")],
[WI.LoggingChannel.Level.Warning, WI.UIString("Warning")],
[WI.LoggingChannel.Level.Info, WI.UIString("Info")],
[WI.LoggingChannel.Level.Debug, WI.UIString("Debug")],
[WI.LoggingChannel.Level.Basic, WI.UIString("Basic")],
[WI.LoggingChannel.Level.Verbose, WI.UIString("Verbose")],
];
const editorLabels = {
media: WI.UIString("Media Logging:"),

0 comments on commit 72ad824

Please sign in to comment.