diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/server/communication/AtmospherePushConnection.java | 30 | ||||
-rw-r--r-- | server/tests/src/com/vaadin/tests/server/ClassesSerializableTest.java | 2 |
2 files changed, 31 insertions, 1 deletions
diff --git a/server/src/com/vaadin/server/communication/AtmospherePushConnection.java b/server/src/com/vaadin/server/communication/AtmospherePushConnection.java index a45d9aa059..e1bc8e212b 100644 --- a/server/src/com/vaadin/server/communication/AtmospherePushConnection.java +++ b/server/src/com/vaadin/server/communication/AtmospherePushConnection.java @@ -26,7 +26,9 @@ import java.io.Writer; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import java.util.logging.ConsoleHandler; import java.util.logging.Level; +import java.util.logging.LogRecord; import java.util.logging.Logger; import org.atmosphere.cpr.AtmosphereResource; @@ -352,4 +354,32 @@ public class AtmospherePushConnection implements PushConnection { private static Logger getLogger() { return Logger.getLogger(AtmospherePushConnection.class.getName()); } + + /** + * Internal method used for reconfiguring loggers to show all Atmosphere log + * messages in the console. + * + * @since + */ + public static void enableAtmosphereDebugLogging() { + Level level = Level.FINEST; + + Logger atmosphereLogger = Logger.getLogger("org.atmosphere"); + if (atmosphereLogger.getLevel() == level) { + // Already enabled + return; + } + + atmosphereLogger.setLevel(level); + + // Without this logging, we will have a ClassCircularityError + LogRecord record = new LogRecord(Level.INFO, + "Enabling Atmosphere debug logging"); + atmosphereLogger.log(record); + + ConsoleHandler ch = new ConsoleHandler(); + ch.setLevel(Level.ALL); + atmosphereLogger.addHandler(ch); + } + } diff --git a/server/tests/src/com/vaadin/tests/server/ClassesSerializableTest.java b/server/tests/src/com/vaadin/tests/server/ClassesSerializableTest.java index 9603032ce5..829ad0455d 100644 --- a/server/tests/src/com/vaadin/tests/server/ClassesSerializableTest.java +++ b/server/tests/src/com/vaadin/tests/server/ClassesSerializableTest.java @@ -73,7 +73,7 @@ public class ClassesSerializableTest extends TestCase { "com\\.vaadin\\.server\\.AbstractClientConnector\\$1\\$1", // "com\\.vaadin\\.server\\.JsonCodec\\$1", // "com\\.vaadin\\.server\\.communication\\.PushConnection", // - "com\\.vaadin\\.server\\.communication\\.AtmospherePushConnection", // + "com\\.vaadin\\.server\\.communication\\.AtmospherePushConnection.*", // "com\\.vaadin\\.util\\.ConnectorHelper", // "com\\.vaadin\\.server\\.VaadinSession\\$FutureAccess", // "com\\.vaadin\\.external\\..*", // |