Refactor logging to be compatible with j2cl.
Change-Id: I0ca9067fd86bc835f3ea6bc3cda53adc49fbc5bc
diff --git a/user/src/com/google/gwt/core/client/impl/ConsoleLogger.java b/dev/core/super/javaemul/internal/ConsoleLogger.java
similarity index 97%
rename from user/src/com/google/gwt/core/client/impl/ConsoleLogger.java
rename to dev/core/super/javaemul/internal/ConsoleLogger.java
index f710202..0974c37 100644
--- a/user/src/com/google/gwt/core/client/impl/ConsoleLogger.java
+++ b/dev/core/super/javaemul/internal/ConsoleLogger.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.google.gwt.core.client.impl;
+package javaemul.internal;
/**
* A helper to print log messages to console.
@@ -47,7 +47,7 @@
log(level, suppressed, "Suppressed: ", false);
}
groupEnd();
- };
+ }
private native void groupStart(String msg, boolean expanded) /*-{
// Not all browsers support grouping:
diff --git a/user/src/com/google/gwt/core/Core.gwt.xml b/user/src/com/google/gwt/core/Core.gwt.xml
index 1079fc1..0f299be 100644
--- a/user/src/com/google/gwt/core/Core.gwt.xml
+++ b/user/src/com/google/gwt/core/Core.gwt.xml
@@ -59,4 +59,23 @@
<add-linker name="soycReport" />
<add-linker name="symbolMaps" />
+
+ <!-- Set up and handle the gwt.logging property
+ Setting this value to FALSE will compile out all logging. Setting it to SEVERE
+ or WARNING means that the logging framework will not compile out, but the basic
+ logging calls like logger.info() and logger.fine() will compile out if it is below
+ the level that is set. Note that something like logger.log(Level.INFO, "foo", e)
+ *will not* compile out at this point. If you have something that is important to
+ have compiled out, you should put it behind a
+ LogConfiguration.isLoggingEnabled(Level.INFO) guard.
+ -->
+ <define-property name="gwt.logging.enabled" values="TRUE, FALSE, SEVERE, WARNING" />
+ <set-property name="gwt.logging.enabled" value="FALSE"/>
+
+ <define-property name="gwt.logging.simpleConsoleHandler" values="ENABLED, DISABLED" />
+ <set-property name="gwt.logging.simpleConsoleHandler" value="ENABLED"/>
+
+ <set-property name="gwt.logging.enabled" value="TRUE">
+ <when-property-is name="superdevmode" value="on"/>
+ </set-property>
</module>
diff --git a/user/src/com/google/gwt/core/client/impl/SuperDevModeLogger.java b/user/src/com/google/gwt/core/client/impl/SuperDevModeLogger.java
index 341eb76..9a2127a 100644
--- a/user/src/com/google/gwt/core/client/impl/SuperDevModeLogger.java
+++ b/user/src/com/google/gwt/core/client/impl/SuperDevModeLogger.java
@@ -17,6 +17,8 @@
import com.google.gwt.core.shared.impl.JsLogger;
+import javaemul.internal.ConsoleLogger;
+
/**
* The implementation of GWT.log() used when Super Dev Mode is on.
*/
diff --git a/user/src/com/google/gwt/logging/LogImpl.gwt.xml b/user/src/com/google/gwt/logging/LogImpl.gwt.xml
index b87268d..b28f903 100644
--- a/user/src/com/google/gwt/logging/LogImpl.gwt.xml
+++ b/user/src/com/google/gwt/logging/LogImpl.gwt.xml
@@ -1,52 +1,4 @@
<module>
<inherits name="com.google.gwt.core.Core"/>
-
<source path="impl" />
-
- <!-- Set up and handle the gwt.logging property
- Setting this value to FALSE will compile out all logging. Setting it to SEVERE
- or WARNING means that the logging framework will not compile out, but the basic
- logging calls like logger.info() and logger.fine() will compile out if it is below
- the level that is set. Note that something like logger.log(Level.INFO, "foo", e)
- *will not* compile out at this point. If you have something that is important to
- have compiled out, you should put it behind a
- LogConfiguration.isLoggingEnabled(Level.INFO) guard.
- -->
- <define-property name="gwt.logging.enabled" values="TRUE, FALSE, SEVERE, WARNING" />
- <replace-with class="com.google.gwt.logging.impl.LevelImplRegular">
- <when-type-is class="com.google.gwt.logging.impl.LevelImplNull"/>
- <any>
- <when-property-is name="gwt.logging.enabled" value="TRUE" />
- <when-property-is name="gwt.logging.enabled" value="SEVERE" />
- <when-property-is name="gwt.logging.enabled" value="WARNING" />
- </any>
- </replace-with>
-
- <replace-with class="com.google.gwt.logging.impl.LoggerImplRegular">
- <when-type-is class="com.google.gwt.logging.impl.LoggerImplNull"/>
- <when-property-is name="gwt.logging.enabled" value="TRUE" />
- </replace-with>
- <replace-with class="com.google.gwt.logging.impl.LoggerImplSevere">
- <when-type-is class="com.google.gwt.logging.impl.LoggerImplNull"/>
- <when-property-is name="gwt.logging.enabled" value="SEVERE" />
- </replace-with>
- <replace-with class="com.google.gwt.logging.impl.LoggerImplWarning">
- <when-type-is class="com.google.gwt.logging.impl.LoggerImplNull"/>
- <when-property-is name="gwt.logging.enabled" value="WARNING" />
- </replace-with>
-
- <set-property name="gwt.logging.enabled" value="FALSE"/>
-
- <replace-with class="com.google.gwt.logging.impl.LoggerConfiguratorNull">
- <when-type-is class="com.google.gwt.logging.impl.LoggerConfigurator"/>
- </replace-with>
-
- <!-- Enable simple console logging by default for superdevmode -->
- <replace-with class="com.google.gwt.logging.impl.LoggerConfiguratorConsole">
- <when-type-is class="com.google.gwt.logging.impl.LoggerConfigurator"/>
- <when-property-is name="superdevmode" value="on"/>
- </replace-with>
- <set-property name="gwt.logging.enabled" value="TRUE">
- <when-property-is name="superdevmode" value="on"/>
- </set-property>
-</module>
\ No newline at end of file
+</module>
diff --git a/user/src/com/google/gwt/logging/LoggingDisabled.gwt.xml b/user/src/com/google/gwt/logging/LoggingDisabled.gwt.xml
index f9d244d..f3c5b2a 100644
--- a/user/src/com/google/gwt/logging/LoggingDisabled.gwt.xml
+++ b/user/src/com/google/gwt/logging/LoggingDisabled.gwt.xml
@@ -75,7 +75,7 @@
</replace-with>
<!-- Replace default consoleHandler for better SuperDevMode logging -->
- <replace-with class="com.google.gwt.logging.impl.SimpleConsoleLogHandler">
+ <replace-with class="javaemul.internal.SimpleConsoleLogHandler">
<when-type-is class="com.google.gwt.logging.client.ConsoleLogHandler" />
<all>
<when-property-is name="superdevmode" value="on"/>
@@ -136,7 +136,5 @@
<entry-point class="com.google.gwt.logging.client.LogConfiguration"/>
<!-- Disable simple logging as the app already opted into Logging by inheriting this module -->
- <replace-with class="com.google.gwt.logging.impl.LoggerConfiguratorNull">
- <when-type-is class="com.google.gwt.logging.impl.LoggerConfigurator"/>
- </replace-with>
+ <set-property name="gwt.logging.simpleConsoleHandler" value="DISABLED"/>
</module>
diff --git a/user/src/com/google/gwt/logging/impl/LevelImpl.java b/user/src/com/google/gwt/logging/impl/LevelImpl.java
deleted file mode 100644
index e5c653f..0000000
--- a/user/src/com/google/gwt/logging/impl/LevelImpl.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.logging.impl;
-
-import java.util.logging.Level;
-
-/**
- * Interface for the implementation of Level. We use a LevelImplNull to ensure
- * that logging code compiles out when logging is disabled, and a
- * LevelImplRegular to provide normal functionality when logging is enabled.
- */
-public interface LevelImpl {
- Level parse(String name);
-}
diff --git a/user/src/com/google/gwt/logging/impl/LevelImplNull.java b/user/src/com/google/gwt/logging/impl/LevelImplNull.java
deleted file mode 100644
index 2d4952d..0000000
--- a/user/src/com/google/gwt/logging/impl/LevelImplNull.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.logging.impl;
-
-import java.util.logging.Level;
-
-/**
- * Null implementation for the Level class which ensures that calls to Level
- * compile out when logging is disabled.
- */
-public class LevelImplNull implements LevelImpl {
- public Level parse(String name) {
- return null;
- }
-}
diff --git a/user/src/com/google/gwt/logging/impl/LevelImplRegular.java b/user/src/com/google/gwt/logging/impl/LevelImplRegular.java
deleted file mode 100644
index 2130e2e..0000000
--- a/user/src/com/google/gwt/logging/impl/LevelImplRegular.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.logging.impl;
-
-
-import java.util.Locale;
-import java.util.logging.Level;
-
-/**
- * Implementation for the Level class when logging is enabled.
- */
-public class LevelImplRegular implements LevelImpl {
- @Override
- public Level parse(String name) {
- name = name.toUpperCase(Locale.ROOT);
- if (name.equals("ALL")) {
- return Level.ALL;
- } else if (name.equals("CONFIG")) {
- return Level.CONFIG;
- } else if (name.equals("FINE")) {
- return Level.FINE;
- } else if (name.equals("FINER")) {
- return Level.FINER;
- } else if (name.equals("FINEST")) {
- return Level.FINEST;
- } else if (name.equals("INFO")) {
- return Level.INFO;
- } else if (name.equals("OFF")) {
- return Level.OFF;
- } else if (name.equals("SEVERE")) {
- return Level.SEVERE;
- } else if (name.equals("WARNING")) {
- return Level.WARNING;
- }
- throw new IllegalArgumentException("Invalid level \"" + name + "\""); }
-}
diff --git a/user/src/com/google/gwt/logging/impl/LoggerConfigurator.java b/user/src/com/google/gwt/logging/impl/LoggerConfigurator.java
deleted file mode 100644
index 79b6ef0..0000000
--- a/user/src/com/google/gwt/logging/impl/LoggerConfigurator.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2014 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.logging.impl;
-
-import java.util.logging.Logger;
-
-/**
- * A configurator for {@link Logger}s. When a logger added to {@link java.util.logging.LogManager}
- * for the very first time, it will be configured via the {@link LoggerConfigurator}.
- */
-public interface LoggerConfigurator {
-
- /**
- * Configures the passed in logger instance.
- */
- void configure(Logger logger);
-
-}
diff --git a/user/src/com/google/gwt/logging/impl/LoggerConfiguratorConsole.java b/user/src/com/google/gwt/logging/impl/LoggerConfiguratorConsole.java
deleted file mode 100644
index 7ad905a..0000000
--- a/user/src/com/google/gwt/logging/impl/LoggerConfiguratorConsole.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2014 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.logging.impl;
-
-import java.util.logging.Logger;
-/**
- * A simple {@link LoggerConfigurator} that configures the root logger to log to the console.
- * <p>
- * This is only used when the application doesn't depend on com.google.gwt.logging.Logging.
- */
-class LoggerConfiguratorConsole implements LoggerConfigurator {
-
- @Override
- public void configure(Logger logger) {
- if (logger.getName().isEmpty()) {
- logger.addHandler(new SimpleConsoleLogHandler());
- }
- }
-}
diff --git a/user/src/com/google/gwt/logging/impl/LoggerConfiguratorNull.java b/user/src/com/google/gwt/logging/impl/LoggerConfiguratorNull.java
deleted file mode 100644
index 094a677..0000000
--- a/user/src/com/google/gwt/logging/impl/LoggerConfiguratorNull.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2014 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.logging.impl;
-
-import java.util.logging.Logger;
-
-/**
- * A {@link LoggerConfigurator} that does nothing.
- */
-class LoggerConfiguratorNull implements LoggerConfigurator {
- @Override
- public void configure(Logger logger) {
- // Nothing todo
- }
-}
diff --git a/user/src/com/google/gwt/logging/impl/LoggerImpl.java b/user/src/com/google/gwt/logging/impl/LoggerImpl.java
deleted file mode 100644
index c202a2f..0000000
--- a/user/src/com/google/gwt/logging/impl/LoggerImpl.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.logging.impl;
-
-import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-import java.util.logging.Logger;
-
-/**
- * Interface for the implementation of Logger. We use a LoggerImplNull to ensure
- * that logging code compiles out when logging is disabled, and a
- * LoggerImplRegular to provide normal functionality when logging is enabled.
- */
-public interface LoggerImpl {
- void addHandler(Handler handler);
- void config(String msg);
- void fine(String msg);
- void finer(String msg);
- void finest(String msg);
-
- /**
- * Get the handlers attached to this logger.
- * @return the array of handlers, or null if there are no handlers
- */
- Handler[] getHandlers();
-
- Level getLevel();
- String getName();
- Logger getParent();
- boolean getUseParentHandlers();
- void info(String msg);
- boolean isLoggable(Level messageLevel);
- void log(Level level, String msg);
- void log(Level level, String msg, Throwable thrown);
- void log(LogRecord record);
- void removeHandler(Handler handler);
- void setLevel(Level newLevel);
- void setName(String newName);
- void setParent(Logger newParent);
- void setUseParentHandlers(boolean newUseParentHandlers);
- void severe(String msg);
- void warning(String msg);
-}
diff --git a/user/src/com/google/gwt/logging/impl/LoggerImplNull.java b/user/src/com/google/gwt/logging/impl/LoggerImplNull.java
deleted file mode 100644
index f7849c1..0000000
--- a/user/src/com/google/gwt/logging/impl/LoggerImplNull.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.logging.impl;
-
-import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-import java.util.logging.Logger;
-
-/**
- * Null implementation for the Logger class which ensures that calls to Logger
- * compile out when logging is disabled.
- */
-public class LoggerImplNull implements LoggerImpl {
-
- public void addHandler(Handler handler) {
- // Do nothing
- }
-
- public void config(String msg) {
- // Do nothing
- }
-
- public void fine(String msg) {
- // Do nothing
- }
-
- public void finer(String msg) {
- // Do nothing
- }
-
- public void finest(String msg) {
- // Do nothing
- }
-
- public Handler[] getHandlers() {
- return null;
- }
-
- public Level getLevel() {
- return null;
- }
-
- public String getName() {
- return "";
- }
-
- public Logger getParent() {
- return null;
- }
-
- public boolean getUseParentHandlers() {
- return false;
- }
-
- public void info(String msg) {
- // Do nothing
- }
-
- public boolean isLoggable(Level messageLevel) {
- return false;
- }
-
- public void log(Level level, String msg) {
- // Do nothing
- }
-
- public void log(Level level, String msg, Throwable thrown) {
- // Do nothing
- }
-
- public void log(LogRecord record) {
- // Do nothing
- }
-
- public void removeHandler(Handler handler) {
- // Do nothing
- }
-
- public void setLevel(Level newLevel) {
- // Do nothing
- }
-
- public void setName(String newName) {
- // Do nothing
- }
-
- public void setParent(Logger newParent) {
- // Do nothing
- }
-
- public void setUseParentHandlers(boolean newUseParentHandlers) {
- // Do nothing
- }
-
- public void severe(String msg) {
- // Do nothing
- }
-
- public void warning(String msg) {
- // Do nothing
- }
-}
diff --git a/user/src/com/google/gwt/logging/impl/LoggerImplRegular.java b/user/src/com/google/gwt/logging/impl/LoggerImplRegular.java
deleted file mode 100644
index e87caab..0000000
--- a/user/src/com/google/gwt/logging/impl/LoggerImplRegular.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.logging.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-import java.util.logging.Logger;
-
-/**
- * Implementation for the Logger class when logging is enabled.
- */
-public class LoggerImplRegular implements LoggerImpl {
- private List<Handler> handlers;
- private Level level = null;
- private String name;
- private Logger parent; // Should never be null except in the RootLogger
- private boolean useParentHandlers;
-
- public LoggerImplRegular() {
- this.useParentHandlers = true;
- handlers = new ArrayList<Handler>();
- }
-
- public void addHandler(Handler handler) {
- handlers.add(handler);
- }
-
- public void config(String msg) {
- log(Level.CONFIG, msg);
- }
-
- public void fine(String msg) {
- log(Level.FINE, msg);
- }
-
- public void finer(String msg) {
- log(Level.FINER, msg);
- }
-
- public void finest(String msg) {
- log(Level.FINEST, msg);
- }
-
- public Handler[] getHandlers() {
- return handlers.toArray(new Handler[handlers.size()]);
- }
-
- public Level getLevel() {
- return level;
- }
-
- public String getName() {
- return name;
- }
-
- public Logger getParent() {
- return parent;
- }
-
- public boolean getUseParentHandlers() {
- return useParentHandlers;
- }
-
- public void info(String msg) {
- log(Level.INFO, msg);
- }
-
- public boolean isLoggable(Level messageLevel) {
- return getEffectiveLevel().intValue() <= messageLevel.intValue();
- }
-
- public void log(Level level, String msg) {
- log(level, msg, null);
- }
-
- public void log(Level level, String msg, Throwable thrown) {
- if (isLoggable(level)) {
- LogRecord record = new LogRecord(level, msg);
- record.setThrown(thrown);
- record.setLoggerName(getName());
- log(record);
- }
- }
-
- public void log(LogRecord record) {
- if (isLoggable(record.getLevel())) {
- for (Handler handler : getHandlers()) {
- handler.publish(record);
- }
- Logger logger = getUseParentHandlers() ? getParent() : null;
- while (logger != null) {
- for (Handler handler : logger.getHandlers()) {
- handler.publish(record);
- }
- logger = logger.getUseParentHandlers() ? logger.getParent() : null;
- }
- }
- }
-
- public void removeHandler(Handler handler) {
- handlers.remove(handler);
- }
-
- public void setLevel(Level newLevel) {
- level = newLevel;
- }
-
- public void setName(String newName) {
- name = newName;
- }
-
- public void setParent(Logger newParent) {
- if (newParent != null) {
- parent = newParent;
- }
- }
-
- public void setUseParentHandlers(boolean newUseParentHandlers) {
- useParentHandlers = newUseParentHandlers;
- }
-
- public void severe(String msg) {
- log(Level.SEVERE, msg);
- }
-
- public void warning(String msg) {
- log(Level.WARNING, msg);
- }
-
- private Level getEffectiveLevel() {
- if (level != null) {
- return level;
- }
- Logger logger = getParent();
- while (logger != null) {
- Level effectiveLevel = logger.getLevel();
- if (effectiveLevel != null) {
- return effectiveLevel;
- }
- logger = logger.getParent();
- }
- return Level.INFO;
- }
-}
diff --git a/user/src/com/google/gwt/logging/impl/LoggerImplSevere.java b/user/src/com/google/gwt/logging/impl/LoggerImplSevere.java
deleted file mode 100644
index d085d91..0000000
--- a/user/src/com/google/gwt/logging/impl/LoggerImplSevere.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright 2011 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.logging.impl;
-
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-
-/**
- * Implementation for the Logger class when logging is enabled only at Severe and above.
- */
-public class LoggerImplSevere extends LoggerImplRegular {
- @Override
- public void config(String msg) {
- // Do nothing
- }
-
- @Override
- public void fine(String msg) {
- // Do nothing
- }
-
- @Override
- public void finer(String msg) {
- // Do nothing
- }
-
- @Override
- public void finest(String msg) {
- // Do nothing
- }
-
- @Override
- public void info(String msg) {
- // Do nothing
- }
-
- @Override
- public void log(Level level, String msg) {
- if (level.intValue() >= 1000) {
- super.log(level, msg);
- }
- }
-
- @Override
- public void log(Level level, String msg, Throwable thrown) {
- if (level.intValue() >= 1000) {
- super.log(level, msg, thrown);
- }
- }
-
- @Override
- public void log(LogRecord record) {
- if (record.getLevel().intValue() >= 1000) {
- super.log(record);
- }
- }
-
- @Override
- public void severe(String msg) {
- super.severe(msg);
- }
-
- @Override
- public void warning(String msg) {
- // Do nothing
- }
-}
diff --git a/user/src/com/google/gwt/logging/impl/LoggerImplWarning.java b/user/src/com/google/gwt/logging/impl/LoggerImplWarning.java
deleted file mode 100644
index 3dbca61..0000000
--- a/user/src/com/google/gwt/logging/impl/LoggerImplWarning.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright 2011 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.logging.impl;
-
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-
-/**
- * Implementation for the Logger class when logging is enabled only at Warning and above.
- */
-public class LoggerImplWarning extends LoggerImplRegular {
- @Override
- public void config(String msg) {
- // Do nothing
- }
-
- @Override
- public void fine(String msg) {
- // Do nothing
- }
-
- @Override
- public void finer(String msg) {
- // Do nothing
- }
-
- @Override
- public void finest(String msg) {
- // Do nothing
- }
-
- @Override
- public void info(String msg) {
- // Do nothing
- }
-
- @Override
- public void log(Level level, String msg) {
- if (level.intValue() >= Level.WARNING.intValue()) {
- super.log(level, msg);
- }
- }
-
- @Override
- public void log(Level level, String msg, Throwable thrown) {
- if (level.intValue() >= Level.WARNING.intValue()) {
- super.log(level, msg, thrown);
- }
- }
-
- @Override
- public void log(LogRecord record) {
- if (record.getLevel().intValue() >= Level.WARNING.intValue()) {
- super.log(record);
- }
- }
-
- @Override
- public void severe(String msg) {
- super.severe(msg);
- }
-
- @Override
- public void warning(String msg) {
- super.warning(msg);
- }
-}
diff --git a/user/super/com/google/gwt/emul/Emulation.gwt.xml b/user/super/com/google/gwt/emul/Emulation.gwt.xml
index 41b5213..31db233 100644
--- a/user/super/com/google/gwt/emul/Emulation.gwt.xml
+++ b/user/super/com/google/gwt/emul/Emulation.gwt.xml
@@ -16,8 +16,6 @@
<!-- Do not inherit this module directly; inherit com.google.gwt.core.Core. -->
<module>
<inherits name="javaemul.internal.Internal"/>
- <inherits name="com.google.gwt.logging.LogImpl"/>
- <public path="public" />
<extend-configuration-property name="compiler.enum.obfuscate.names.blacklist"
value="java.math.RoundingMode" />
diff --git a/user/super/com/google/gwt/emul/java/util/logging/Level.java b/user/super/com/google/gwt/emul/java/util/logging/Level.java
index eaed069..d6a416c 100644
--- a/user/super/com/google/gwt/emul/java/util/logging/Level.java
+++ b/user/super/com/google/gwt/emul/java/util/logging/Level.java
@@ -1,12 +1,12 @@
/*
* Copyright 2010 Google Inc.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -16,19 +16,16 @@
package java.util.logging;
-import com.google.gwt.core.shared.GWT;
-import com.google.gwt.logging.impl.LevelImpl;
-import com.google.gwt.logging.impl.LevelImplNull;
-
import java.io.Serializable;
+import java.util.Locale;
/**
- * An emulation of the java.util.logging.Level class. See
- * <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/Level.html">
+ * An emulation of the java.util.logging.Level class. See
+ * <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/Level.html">
* The Java API doc for details</a>
*/
public class Level implements Serializable {
- private static LevelImpl staticImpl = GWT.create(LevelImplNull.class);
+
public static Level ALL = new LevelAll();
public static Level CONFIG = new LevelConfig();
public static Level FINE = new LevelFine();
@@ -38,7 +35,7 @@
public static Level OFF = new LevelOff();
public static Level SEVERE = new LevelSevere();
public static Level WARNING = new LevelWarning();
-
+
private static class LevelAll extends Level {
@Override public String getName() { return "ALL"; }
@Override public int intValue() { return Integer.MIN_VALUE; }
@@ -48,7 +45,7 @@
@Override public String getName() { return "CONFIG"; }
@Override public int intValue() { return 700; }
}
-
+
private static class LevelFine extends Level {
@Override public String getName() { return "FINE"; }
@Override public int intValue() { return 500; }
@@ -62,13 +59,13 @@
private static class LevelFinest extends Level {
@Override public String getName() { return "FINEST"; }
@Override public int intValue() { return 300; }
- }
-
+ }
+
private static class LevelInfo extends Level {
@Override public String getName() { return "INFO"; }
@Override public int intValue() { return 800; }
}
-
+
private static class LevelOff extends Level {
@Override public String getName() { return "OFF"; }
@Override public int intValue() { return Integer.MAX_VALUE; }
@@ -85,28 +82,54 @@
}
public static Level parse(String name) {
- return staticImpl.parse(name);
- }
+ Logger.assertLoggingValues();
+ boolean loggingDisabled = System.getProperty("gwt.logging.enabled", "FALSE").equals("FALSE");
+ if (loggingDisabled) {
+ return null;
+ }
+
+ name = name.toUpperCase(Locale.ROOT);
+ if (name.equals("ALL")) {
+ return ALL;
+ } else if (name.equals("CONFIG")) {
+ return CONFIG;
+ } else if (name.equals("FINE")) {
+ return FINE;
+ } else if (name.equals("FINER")) {
+ return FINER;
+ } else if (name.equals("FINEST")) {
+ return FINEST;
+ } else if (name.equals("INFO")) {
+ return INFO;
+ } else if (name.equals("OFF")) {
+ return OFF;
+ } else if (name.equals("SEVERE")) {
+ return SEVERE;
+ } else if (name.equals("WARNING")) {
+ return WARNING;
+ }
+ throw new IllegalArgumentException("Invalid level \"" + name + "\"");
+ }
protected Level() { }
-
+
public String getName() {
return "DUMMY";
}
-
+
public int intValue() {
return -1;
}
-
+
@Override
public String toString() {
return getName();
}
-
+
/* Not Implemented */
- // public boolean equals(Object ox) {}
- // protected Level(String name, int value, String resourceBundleName) {}
+ // public boolean equals(Object ox) {}
+ // protected Level(String name, int value, String resourceBundleName) {}
// public String getLocalizedName() {}
- // public String getResourceBundleName() {}
+ // public String getResourceBundleName() {}
// public int hashCode() {}
}
diff --git a/user/super/com/google/gwt/emul/java/util/logging/LogManager.java b/user/super/com/google/gwt/emul/java/util/logging/LogManager.java
index c67b285..e5c3b68 100644
--- a/user/super/com/google/gwt/emul/java/util/logging/LogManager.java
+++ b/user/super/com/google/gwt/emul/java/util/logging/LogManager.java
@@ -1,12 +1,12 @@
/*
* Copyright 2010 Google Inc.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -16,22 +16,19 @@
package java.util.logging;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.logging.impl.LoggerConfigurator;
-
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
/**
- * An emulation of the java.util.logging.LogManager class. See
- * <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/LogManger.html">
+ * An emulation of the java.util.logging.LogManager class. See
+ * <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/LogManger.html">
* The Java API doc for details</a>
*/
public class LogManager {
private static LogManager singleton;
-
+
public static LogManager getLogManager() {
if (singleton == null) {
singleton = new LogManager();
@@ -41,12 +38,11 @@
}
return singleton;
}
-
- private LoggerConfigurator loggerConfigurator = GWT.create(LoggerConfigurator.class);
+
private HashMap<String, Logger> loggerMap = new HashMap<String, Logger>();
-
+
protected LogManager() { }
-
+
public boolean addLogger(Logger logger) {
if (getLogger(logger.getName()) != null) {
return false;
@@ -62,11 +58,11 @@
public Enumeration<String> getLoggerNames() {
return Collections.enumeration(loggerMap.keySet());
}
-
+
/**
* Helper function to add a logger when we have already determined that it
* does not exist. When we add a logger, we recursively add all of it's
- * ancestors. Since loggers do not get removed, logger creation is cheap,
+ * ancestors. Since loggers do not get removed, logger creation is cheap,
* and there are not usually too many loggers in an ancestry chain,
* this is a simple way to ensure that the parent/child relationships are
* always correctly set up.
@@ -79,15 +75,19 @@
}
private void addLoggerImpl(Logger logger) {
- loggerConfigurator.configure(logger);
+ if (System.getProperty("gwt.logging.simpleConsoleHandler", "ENABLED").equals("ENABLED")) {
+ if (logger.getName().isEmpty()) {
+ logger.addHandler(new SimpleConsoleLogHandler());
+ }
+ }
loggerMap.put(logger.getName(), logger);
}
-
+
/**
* Helper function to create a logger if it does not exist since the public
* APIs for getLogger and addLogger make it difficult to use those functions
* for this.
- */
+ */
Logger ensureLogger(String name) {
Logger logger = getLogger(name);
if (logger == null) {
@@ -97,13 +97,13 @@
}
return logger;
}
-
+
/* Not Implemented */
// public void addPropertyChangeListener(PropertyChangeListener l) {}
// public void checkAccess() {}
// public String getProperty(String name) {}
// public void readConfiguration() {}
// public void readConfiguration(InputStream ins) {}
- // public void removePropertyChangeListener(PropertyChangeListener l) {}
- // public void reset() {}
+ // public void removePropertyChangeListener(PropertyChangeListener l) {}
+ // public void reset() {}
}
diff --git a/user/super/com/google/gwt/emul/java/util/logging/Logger.java b/user/super/com/google/gwt/emul/java/util/logging/Logger.java
index a64a5a3..36840e9 100644
--- a/user/super/com/google/gwt/emul/java/util/logging/Logger.java
+++ b/user/super/com/google/gwt/emul/java/util/logging/Logger.java
@@ -1,12 +1,12 @@
/*
* Copyright 2010 Google Inc.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -15,18 +15,31 @@
*/
package java.util.logging;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.logging.impl.LoggerImpl;
-import com.google.gwt.logging.impl.LoggerImplNull;
+import java.util.ArrayList;
+import java.util.List;
/**
- * An emulation of the java.util.logging.Logger class. See
- * <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/Logger.html">
+ * An emulation of the java.util.logging.Logger class. See
+ * <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/Logger.html">
* The Java API doc for details</a>
*/
public class Logger {
- public static final String GLOBAL_LOGGER_NAME = "global";
+public static final String GLOBAL_LOGGER_NAME = "global";
+
+ private static final boolean SUPER_DEV_MODE =
+ System.getProperty("superdevmode", "off").equals("on");
+
+ private static final String LOGGING_ENABLED =
+ System.getProperty("gwt.logging.enabled", SUPER_DEV_MODE ? "TRUE" : "FALSE");
+
+ private static final boolean LOGGING_WARNING = LOGGING_ENABLED.equals("WARNING");
+ private static final boolean LOGGING_SEVERE = LOGGING_ENABLED.equals("SEVERE");
+ private static final boolean LOGGING_FALSE = LOGGING_ENABLED.equals("FALSE");
+
+ static {
+ assertLoggingValues();
+ }
public static Logger getGlobal() {
return getLogger(GLOBAL_LOGGER_NAME);
@@ -34,125 +47,253 @@
public static Logger getLogger(String name) {
// Use shortcut if logging is disabled to avoid parent logger creations in LogManager
- if (GWT.create(LoggerImplNull.class) instanceof LoggerImplNull) {
+ if (LOGGING_FALSE) {
return new Logger(name, "");
}
return LogManager.getLogManager().ensureLogger(name);
}
- private LoggerImpl impl;
-
- protected Logger(String name, String resourceName) {
- impl = GWT.create(LoggerImplNull.class);
- impl.setName(name);
+ static void assertLoggingValues() {
+ if (LOGGING_ENABLED.equals("FALSE") || LOGGING_ENABLED.equals("TRUE")
+ || LOGGING_ENABLED.equals("SEVERE") || LOGGING_ENABLED.equals("WARNING")) {
+ return;
+ }
+
+ throw new RuntimeException("Undefined value for gwt.logging.enabled: '" + LOGGING_ENABLED
+ + "'. Allowed values are TRUE, FALSE, SEVERE, WARNING");
+ }
+
+ private List<Handler> handlers;
+ private Level level = null;
+ private String name;
+ private Logger parent; // Should never be null except in the RootLogger
+ private boolean useParentHandlers;
+
+ protected Logger(String name, @SuppressWarnings("unused") String resourceName) {
+ if (LOGGING_FALSE) {
+ return;
+ }
+
+ this.name = name;
+ this.useParentHandlers = true;
+ handlers = new ArrayList<Handler>();
}
public void addHandler(Handler handler) {
- impl.addHandler(handler);
+ if (LOGGING_FALSE) {
+ return;
+ }
+ handlers.add(handler);
}
-
+
public void config(String msg) {
- impl.config(msg);
- }
-
+ if (LOGGING_FALSE || LOGGING_SEVERE || LOGGING_WARNING) {
+ return;
+ }
+ log(Level.CONFIG, msg);
+ }
+
public void fine(String msg) {
- impl.fine(msg);
- }
-
+ if (LOGGING_FALSE || LOGGING_SEVERE || LOGGING_WARNING) {
+ return;
+ }
+ log(Level.FINE, msg);
+ }
+
public void finer(String msg) {
- impl.finer(msg);
+ if (LOGGING_FALSE || LOGGING_SEVERE || LOGGING_WARNING) {
+ return;
+ }
+ log(Level.FINER, msg);
}
-
+
public void finest(String msg) {
- impl.finest(msg);
+ if (LOGGING_FALSE || LOGGING_SEVERE || LOGGING_WARNING) {
+ return;
+ }
+ log(Level.FINEST, msg);
}
-
- public Handler[] getHandlers() {
- return impl.getHandlers();
- }
-
- public Level getLevel() {
- return impl.getLevel();
- }
-
- public String getName() {
- return impl.getName();
- }
-
- public Logger getParent() {
- return impl.getParent();
- }
-
- public boolean getUseParentHandlers() {
- return impl.getUseParentHandlers();
- }
-
+
public void info(String msg) {
- impl.info(msg);
- }
-
+ if (LOGGING_FALSE || LOGGING_SEVERE || LOGGING_WARNING) {
+ return;
+ }
+ log(Level.INFO, msg);
+ }
+
+ public void warning(String msg) {
+ if (LOGGING_FALSE || LOGGING_SEVERE) {
+ return;
+ }
+ log(Level.WARNING, msg);
+ }
+
+ public void severe(String msg) {
+ if (LOGGING_FALSE) {
+ return;
+ }
+ log(Level.SEVERE, msg);
+ }
+
+ public Handler[] getHandlers() {
+ if (LOGGING_FALSE) {
+ return new Handler[0];
+ }
+
+ return handlers.toArray(new Handler[handlers.size()]);
+ }
+
+ public Level getLevel() {
+ return LOGGING_FALSE ? null : level;
+ }
+
+ public String getName() {
+ return LOGGING_FALSE ? null : name;
+ }
+
+ public Logger getParent() {
+ return LOGGING_FALSE ? null : parent;
+ }
+
+ public boolean getUseParentHandlers() {
+ return LOGGING_FALSE ? null : useParentHandlers;
+ }
+
public boolean isLoggable(Level messageLevel) {
- return impl.isLoggable(messageLevel);
+ return LOGGING_FALSE
+ ? false : getEffectiveLevel().intValue() <= messageLevel.intValue();
}
-
+
public void log(Level level, String msg) {
- impl.log(level, msg);
+ log(level, msg, null);
}
-
+
public void log(Level level, String msg, Throwable thrown) {
- impl.log(level, msg, thrown);
+ if (LOGGING_FALSE) {
+ return;
+ }
+ if (LOGGING_SEVERE) {
+ if (level.intValue() >= 1000) {
+ actuallyLog(level, msg, thrown);
+ }
+ } else if (LOGGING_WARNING) {
+ if (level.intValue() >= Level.WARNING.intValue()) {
+ actuallyLog(level, msg, thrown);
+ }
+ } else {
+ actuallyLog(level, msg, thrown);
+ }
}
public void log(LogRecord record) {
- impl.log(record);
+ if (LOGGING_FALSE) {
+ return;
+ }
+ if (LOGGING_SEVERE) {
+ if (level.intValue() >= 1000) {
+ actuallyLog(record);
+ }
+ } else if (LOGGING_WARNING) {
+ if (level.intValue() >= Level.WARNING.intValue()) {
+ actuallyLog(record);
+ }
+ } else {
+ actuallyLog(record);
+ }
}
-
+
public void removeHandler(Handler handler) {
- impl.removeHandler(handler);
+ if (LOGGING_FALSE) {
+ return;
+ }
+ handlers.remove(handler);
}
-
+
public void setLevel(Level newLevel) {
- impl.setLevel(newLevel);
+ if (LOGGING_FALSE) {
+ return;
+ }
+ this.level = newLevel;
}
-
+
public void setParent(Logger newParent) {
- impl.setParent(newParent);
+ if (LOGGING_FALSE) {
+ return;
+ }
+ if (newParent != null) {
+ parent = newParent;
+ }
}
-
+
public void setUseParentHandlers(boolean newUseParentHandlers) {
- impl.setUseParentHandlers(newUseParentHandlers);
+ if (LOGGING_FALSE) {
+ return;
+ }
+ this.useParentHandlers = newUseParentHandlers;
}
-
- public void severe(String msg) {
- impl.severe(msg);
+
+ private Level getEffectiveLevel() {
+ if (level != null) {
+ return level;
+ }
+
+ Logger logger = getParent();
+ while (logger != null) {
+ Level effectiveLevel = logger.getLevel();
+ if (effectiveLevel != null) {
+ return effectiveLevel;
+ }
+ logger = logger.getParent();
+ }
+ return Level.INFO;
}
-
- public void warning(String msg) {
- impl.warning(msg);
+
+ private void actuallyLog(Level level, String msg, Throwable thrown) {
+ if (isLoggable(level)) {
+ LogRecord record = new LogRecord(level, msg);
+ record.setThrown(thrown);
+ record.setLoggerName(getName());
+ actuallyLog(record);
+ }
}
-
+
+ private void actuallyLog(LogRecord record) {
+ if (isLoggable(record.getLevel())) {
+ for (Handler handler : getHandlers()) {
+ handler.publish(record);
+ }
+ Logger logger = getUseParentHandlers() ? getParent() : null;
+ while (logger != null) {
+ for (Handler handler : logger.getHandlers()) {
+ handler.publish(record);
+ }
+ logger = logger.getUseParentHandlers() ? logger.getParent() : null;
+ }
+ }
+ }
+
/* Not Implemented */
// public static Logger getAnonymousLogger() {
- // public static Logger getAnonymousLogger(String resourceBundleName) {}
+ // public static Logger getAnonymousLogger(String resourceBundleName) {}
// public Filter getFilter() {}
- // public static Logger getLogger(String name, String resourceBundleName) {}
- // public ResourceBundle getResourceBundle() {}
+ // public static Logger getLogger(String name, String resourceBundleName) {}
+ // public ResourceBundle getResourceBundle() {}
// public String getResourceBundleName() {}
// public void setFilter(Filter newFilter) {}
- // public void entering(String sourceClass, String sourceMethod) {}
- // public void entering(String sourceClass, String sourceMethod, Object param1) {}
+ // public void entering(String sourceClass, String sourceMethod) {}
+ // public void entering(String sourceClass, String sourceMethod, Object param1) {}
// public void entering(String sourceClass, String sourceMethod, Object[] params) {}
- // public void exiting(String sourceClass, String sourceMethod, Object result) {}
+ // public void exiting(String sourceClass, String sourceMethod, Object result) {}
// public void exiting(String sourceClass, String sourceMethod) {}
- // public void log(Level level, String msg, Object param1) {}
+ // public void log(Level level, String msg, Object param1) {}
// public void log(Level level, String msg, Object[] params) {}
- // public void logp(Level level, String sourceClass, String sourceMethod, String msg) {}
- // public void logp(Level level, String sourceClass, String sourceMethod, String msg, Object param1) {}
+ // public void logp(Level level, String sourceClass, String sourceMethod, String msg) {}
+ // public void logp(Level level, String sourceClass, String sourceMethod, String msg, Object param1) {}
// public void logp(Level level, String sourceClass, String sourceMethod, String msg, Object[] params) {}
// public void logp(Level level, String sourceClass, String sourceMethod, String msg, Throwable thrown) {}
// public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg) {}
- // public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object param1) {}
+ // public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object param1) {}
// public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object[] params) {}
// public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Throwable thrown) {}
- // public void throwing(String sourceClass, String sourceMethod, Throwable thrown) {}
+ // public void throwing(String sourceClass, String sourceMethod, Throwable thrown) {}
}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/logging/impl/SimpleConsoleLogHandler.java b/user/super/com/google/gwt/emul/java/util/logging/SimpleConsoleLogHandler.java
similarity index 88%
rename from user/src/com/google/gwt/logging/impl/SimpleConsoleLogHandler.java
rename to user/super/com/google/gwt/emul/java/util/logging/SimpleConsoleLogHandler.java
index d6c4855..f98b752 100644
--- a/user/src/com/google/gwt/logging/impl/SimpleConsoleLogHandler.java
+++ b/user/super/com/google/gwt/emul/java/util/logging/SimpleConsoleLogHandler.java
@@ -13,14 +13,13 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.google.gwt.logging.impl;
+package java.util.logging;
-import com.google.gwt.core.client.impl.ConsoleLogger;
+import javaemul.internal.ConsoleLogger;
-import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-
+/**
+ * A simple console logger used in super dev mode.
+ */
class SimpleConsoleLogHandler extends Handler {
@Override