}
TreeLogger logger = mainLogger;
TreeLogger.Type maxLevel = options.getLogLevel();
String agentTag = BrowserInfo.getShortName(userAgent);
String remoteSocket = serverChannel.getRemoteEndpoint();
ModuleHandle module = ui.loadModule(userAgent, remoteSocket, url, tabKey,
moduleName, sessionKey, agentTag, userAgentIcon, maxLevel);
// TODO(jat): add support for closing an active module
logger = module.getLogger();
try {
// Try to find an existing loaded version of the module def.
ModuleDef moduleDef = loadModule(logger, moduleName, true);
assert (moduleDef != null);