From ef61babe77a94eba181c95a52c0069a612276dff Mon Sep 17 00:00:00 2001 From: megacz Date: Fri, 30 Jan 2004 07:43:29 +0000 Subject: [PATCH] 2003/12/29 03:25:43 darcs-hash:20040130074329-2ba56-635fe3c3e676f3d1709bee774aebd50d3b74dde5.gz --- src/org/xwt/Box.java | 8 +++--- src/org/xwt/Font.java | 4 +-- src/org/xwt/HTTP.java | 60 ++++++++++++++++++++--------------------- src/org/xwt/LocalStorage.java | 4 +-- src/org/xwt/Main.java | 4 +-- src/org/xwt/Picture.java | 6 ++--- src/org/xwt/Platform.java | 44 +++++++++++++++--------------- src/org/xwt/Res.java | 2 +- src/org/xwt/SOAP.java | 4 +-- src/org/xwt/Scheduler.java | 8 +++--- src/org/xwt/Surface.java | 8 +++--- src/org/xwt/Template.java | 4 +-- src/org/xwt/XMLRPC.java | 16 +++++------ src/org/xwt/XWT.java | 6 ++--- src/org/xwt/plat/AWT.java | 18 ++++++------- 15 files changed, 98 insertions(+), 98 deletions(-) diff --git a/src/org/xwt/Box.java b/src/org/xwt/Box.java index 9dbd0ab..df1cfd6 100644 --- a/src/org/xwt/Box.java +++ b/src/org/xwt/Box.java @@ -68,7 +68,7 @@ public final class Box extends JSScope implements Scheduler.Task { static { Font f = null; try { f = Font.getFont((Res)Main.builtin.get("fonts/vera/Vera.ttf"), 10); } - catch(JSExn e) { Log.log(Box.class, "should never happen: "+e); } + catch(JSExn e) { Log.info(Box.class, "should never happen: "+e); } DEFAULT_FONT = f; } @@ -528,7 +528,7 @@ public final class Box extends JSScope implements Scheduler.Task { case "Close": if (parent == null && getSurface() != null) getSurface().dispose(true); case "toback": if (parent == null && getSurface() != null && toBoolean(value)) { getSurface().toBack(); } case "tofront": if (parent == null && getSurface() != null && toBoolean(value)) { getSurface().toFront(); } - case "redirect": if (redirect == this) redirect = (Box)value; else Log.log(this, "redirect can only be set once"); + case "redirect": if (redirect == this) redirect = (Box)value; else Log.info(this, "redirect can only be set once"); case "font": font = value == null ? null : Font.getFont((Res)value, font == null ? 10 : font.pointsize); MARK_RESIZE; dirty(); case "fontsize": font = Font.getFont(font == null ? null : font.res, toInt(value)); MARK_RESIZE; dirty(); case "x": if (parent==null && Surface.fromBox(this)!=null) { CHECKSET_INT(x); } else { if (test(PACKED) && parent != null) return; CHECKSET_INT(x); dirty(); MARK_RESIZE; dirty(); } @@ -684,7 +684,7 @@ public final class Box extends JSScope implements Scheduler.Task { (Integer.parseInt(s.substring(3, 5), 16) << 8) | Integer.parseInt(s.substring(5, 7), 16); } catch (NumberFormatException e) { - Log.log(Box.class, "invalid color " + s); + Log.info(Box.class, "invalid color " + s); return 0; } else return 0; // FEATURE: error? @@ -821,7 +821,7 @@ public final class Box extends JSScope implements Scheduler.Task { for(Box cur = this; cur != null; cur = cur.parent) if (cur == b) { if (Log.on) Log.logJS(this, "attempt to make a node a parent of its own ancestor"); - if (Log.on) Log.log(this, "box == " + this + " ancestor == " + b); + if (Log.on) Log.info(this, "box == " + this + " ancestor == " + b); return; } diff --git a/src/org/xwt/Font.java b/src/org/xwt/Font.java index 6081253..5124a7a 100644 --- a/src/org/xwt/Font.java +++ b/src/org/xwt/Font.java @@ -120,8 +120,8 @@ public class Font { Glyph g = (Glyph)glyphsToBeRendered.remove(false); if (g == null) { glyphRenderingTaskIsScheduled = false; return; } if (g.isLoaded) { perform(); /* tailcall to the next glyph */ return; } - Log.log(Glyph.class, "rendering glyph " + g.c); - try { freetype.renderGlyph(g); } catch (IOException e) { Log.log(Freetype.class, e); } + Log.info(Glyph.class, "rendering glyph " + g.c); + try { freetype.renderGlyph(g); } catch (IOException e) { Log.info(Freetype.class, e); } g.isLoaded = true; Scheduler.add(this); // keep ourselves in the queue until there are no glyphs to render glyphRenderingTaskIsScheduled = true; diff --git a/src/org/xwt/HTTP.java b/src/org/xwt/HTTP.java index de013f0..a3525e4 100644 --- a/src/org/xwt/HTTP.java +++ b/src/org/xwt/HTTP.java @@ -106,7 +106,7 @@ public class HTTP { else doWebAuth(h, content == null ? "GET" : "POST"); if (h.get("HTTP").equals("1.0") && h.get("content-length") == null) { - if (Log.on) Log.log(this, "proxy returned an HTTP/1.0 reply with no content-length..."); + if (Log.on) Log.info(this, "proxy returned an HTTP/1.0 reply with no content-length..."); reset(); } else { int cl = h.get("content-length") == null ? -1 : Integer.parseInt(h.get("content-length").toString()); @@ -177,11 +177,11 @@ public class HTTP { /** Attempts a direct connection */ private Socket attemptDirect() { try { - if (Log.verbose) Log.log(this, "attempting to create unproxied socket to " + + if (Log.verbose) Log.info(this, "attempting to create unproxied socket to " + host + ":" + port + (ssl ? " [ssl]" : "")); return getSocket(host, port, ssl, true); } catch (IOException e) { - if (Log.on) Log.log(this, "exception in attemptDirect(): " + e); + if (Log.on) Log.info(this, "exception in attemptDirect(): " + e); return null; } } @@ -189,7 +189,7 @@ public class HTTP { /** Attempts to use an HTTP proxy, employing the CONNECT method if HTTPS is requested */ private Socket attemptHttpProxy(String proxyHost, int proxyPort) { try { - if (Log.verbose) Log.log(this, "attempting to create HTTP proxied socket using proxy " + proxyHost + ":" + proxyPort); + if (Log.verbose) Log.info(this, "attempting to create HTTP proxied socket using proxy " + proxyHost + ":" + proxyPort); Socket sock = getSocket(proxyHost, proxyPort, ssl, false); if (!ssl) { @@ -208,7 +208,7 @@ public class HTTP { return sock; } catch (IOException e) { - if (Log.on) Log.log(this, "exception in attemptHttpProxy(): " + e); + if (Log.on) Log.info(this, "exception in attemptHttpProxy(): " + e); return null; } } @@ -224,7 +224,7 @@ public class HTTP { InetAddress addr = null; try { addr = InetAddress.getByName(host); } catch (Exception e) { } - if (Log.verbose) Log.log(this, "attempting to create SOCKSv4" + (addr == null ? "" : "a") + + if (Log.verbose) Log.info(this, "attempting to create SOCKSv4" + (addr == null ? "" : "a") + " proxied socket using proxy " + proxyHost + ":" + proxyPort); try { @@ -254,33 +254,33 @@ public class HTTP { if (ssl) ((SSL)sock).negotiate(); return sock; } - if (Log.on) Log.log(this, "SOCKS server denied access, code " + (success & 0xff)); + if (Log.on) Log.info(this, "SOCKS server denied access, code " + (success & 0xff)); return null; } catch (IOException e) { - if (Log.on) Log.log(this, "exception in attemptSocksProxy(): " + e); + if (Log.on) Log.info(this, "exception in attemptSocksProxy(): " + e); return null; } } /** executes the PAC script and dispatches a call to one of the other attempt methods based on the result */ private Socket attemptPAC(org.xwt.js.JS pacFunc) { - if (Log.verbose) Log.log(this, "evaluating PAC script"); + if (Log.verbose) Log.info(this, "evaluating PAC script"); String pac = null; try { org.xwt.js.JSArray args = new org.xwt.js.JSArray(); Object obj = pacFunc.call(url.toString(), url.getHost(), null, null, 2); - if (Log.verbose) Log.log(this, " PAC script returned \"" + obj + "\""); + if (Log.verbose) Log.info(this, " PAC script returned \"" + obj + "\""); pac = obj.toString(); } catch (Throwable e) { - if (Log.on) Log.log(this, "PAC script threw exception " + e); + if (Log.on) Log.info(this, "PAC script threw exception " + e); return null; } StringTokenizer st = new StringTokenizer(pac, ";", false); while (st.hasMoreTokens()) { String token = st.nextToken().trim(); - if (Log.verbose) Log.log(this, " trying \"" + token + "\"..."); + if (Log.verbose) Log.info(this, " trying \"" + token + "\"..."); try { Socket ret = null; if (token.startsWith("DIRECT")) @@ -293,10 +293,10 @@ public class HTTP { Integer.parseInt(token.substring(token.indexOf(':') + 1))); if (ret != null) return ret; } catch (Throwable e) { - if (Log.on) Log.log(this, "attempt at \"" + token + "\" failed due to " + e + "; trying next token"); + if (Log.on) Log.info(this, "attempt at \"" + token + "\" failed due to " + e + "; trying next token"); } } - if (Log.on) Log.log(this, "all PAC results exhausted"); + if (Log.on) Log.info(this, "all PAC results exhausted"); return null; } @@ -333,7 +333,7 @@ public class HTTP { path = this.url.getFile(); if (port == -1) port = ssl ? 443 : 80; host = this.url.getHost(); - if (Log.verbose) Log.log(this, "creating HTTP object for connection to " + host + ":" + port); + if (Log.verbose) Log.info(this, "creating HTTP object for connection to " + host + ":" + port); Proxy pi = Platform.detectProxy(); OUTER: do { @@ -414,13 +414,13 @@ public class HTTP { } private void doProxyAuth(Hashtable h0, String method) throws IOException { - if (Log.on) Log.log(this, "Proxy AuthChallenge: " + h0.get("proxy-authenticate")); + if (Log.on) Log.info(this, "Proxy AuthChallenge: " + h0.get("proxy-authenticate")); Hashtable h = parseAuthenticationChallenge(h0.get("proxy-authenticate").toString()); String style = h.get("AUTHTYPE").toString(); String realm = (String)h.get("realm"); if (style.equals("NTLM") && Proxy.Authorization.authorization2 == null) { - Log.log(this, "Proxy identified itself as NTLM, sending Type 1 packet"); + Log.info(this, "Proxy identified itself as NTLM, sending Type 1 packet"); Proxy.Authorization.authorization2 = "NTLM " + Base64.encode(Proxy.NTLM.type1); return; } @@ -449,7 +449,7 @@ public class HTTP { "algorithm=MD5"; } else if (style.equals("NTLM")) { - Log.log(this, "Proxy identified itself as NTLM, got Type 2 packet"); + Log.info(this, "Proxy identified itself as NTLM, got Type 2 packet"); byte[] type2 = Base64.decode(((String)h0.get("proxy-authenticate")).substring(5).trim()); for(int i=0; i startargs + 1 ? args[startargs + 1] : "main"; initialTemplateName = initialTemplateName.replace('.', '/'); @@ -75,7 +75,7 @@ public class Main { initialTemplate = initialTemplateName; } - if (Log.on) Log.log(Main.class, "loading xwar"); + if (Log.on) Log.info(Main.class, "loading xwar"); final XWT xwt = new XWT(rr); final Res final_rr = rr; diff --git a/src/org/xwt/Picture.java b/src/org/xwt/Picture.java index c4cb039..4d563e0 100644 --- a/src/org/xwt/Picture.java +++ b/src/org/xwt/Picture.java @@ -54,7 +54,7 @@ public class Picture { } // could not find image - if (in == null) { Log.log(Picture.class, "couldn't load image for resource " + r); return; } + if (in == null) { Log.info(Picture.class, "couldn't load image for resource " + r); return; } try { PushbackInputStream pbis = new PushbackInputStream(in); @@ -68,8 +68,8 @@ public class Picture { p.isLoaded = true; Scheduler.add(callback); } catch (Exception e) { - Log.log(this, "exception while loading image"); - Log.log(this, e); + Log.info(this, "exception while loading image"); + Log.info(this, e); } } }.start(); diff --git a/src/org/xwt/Platform.java b/src/org/xwt/Platform.java index d3b0c19..abbf3ec 100644 --- a/src/org/xwt/Platform.java +++ b/src/org/xwt/Platform.java @@ -65,27 +65,27 @@ public abstract class Platform { build = (String)Class.forName("org.xwt.Build").getField("build").get(null); } catch (ClassNotFoundException cnfe) { } catch (Exception e) { - if (Log.on) Log.log(Platform.class, "exception while detecting build:"); - if (Log.on) Log.log(Platform.class, e); + if (Log.on) Log.info(Platform.class, "exception while detecting build:"); + if (Log.on) Log.info(Platform.class, e); } - if (Log.on) Log.log(Platform.class, "XWT build: " + build); + if (Log.on) Log.info(Platform.class, "XWT build: " + build); - if (Log.on) Log.log(Platform.class, "XWT VM detection: vendor = " + vendor); - if (Log.on) Log.log(Platform.class, " version = " + version); - if (Log.on) Log.log(Platform.class, " os = " + os_name + " [version " + os_version + "]"); + if (Log.on) Log.info(Platform.class, "XWT VM detection: vendor = " + vendor); + if (Log.on) Log.info(Platform.class, " version = " + version); + if (Log.on) Log.info(Platform.class, " os = " + os_name + " [version " + os_version + "]"); if (platform_class == null) { - if (Log.on) Log.log(Platform.class, "Unable to detect JVM"); + if (Log.on) Log.info(Platform.class, "Unable to detect JVM"); criticalAbort("Unable to detect JVM"); } - if (Log.on) Log.log(Platform.class, " platform = " + platform.getDescriptiveName()); - if (Log.on) Log.log(Platform.class, " class = " + platform.getClass().getName()); + if (Log.on) Log.info(Platform.class, " platform = " + platform.getDescriptiveName()); + if (Log.on) Log.info(Platform.class, " class = " + platform.getClass().getName()); platform.postInit(); } catch (Exception e) { - if (Log.on) Log.log(Platform.class, "Exception while trying to detect JVM"); - if (Log.on) Log.log(Platform.class, e); + if (Log.on) Log.info(Platform.class, "Exception while trying to detect JVM"); + if (Log.on) Log.info(Platform.class, e); criticalAbort("Unable to detect JVM"); } @@ -184,8 +184,8 @@ public abstract class Platform { if (s.startsWith(key + "=")) return s.substring(key.length() + 1); } catch (Exception e) { - if (Log.on) Log.log(this, "Exception while reading from environment:"); - if (Log.on) Log.log(this, e); + if (Log.on) Log.info(this, "Exception while reading from environment:"); + if (Log.on) Log.info(this, e); } return null; } @@ -207,14 +207,14 @@ public abstract class Platform { Method m = c.getMethod("openURL", new Class[] { String.class }); m.invoke(null, new String[] { url }); } catch (Exception e) { - Log.log(this, e); + Log.info(this, e); } } /** opens a new browser window */ public static void newBrowserWindow(String url) { if (!(url.startsWith("https://") || url.startsWith("http://") || url.startsWith("ftp://") || url.startsWith("mailto:"))) { - if (Log.on) Log.log(Platform.class, "xwt.newBrowserWindow() only supports http and https urls"); + if (Log.on) Log.info(Platform.class, "xwt.newBrowserWindow() only supports http and https urls"); return; } @@ -224,18 +224,18 @@ public abstract class Platform { if (u.startsWith("https")) u = "http" + u.substring(5); new URL(u); } catch (MalformedURLException e) { - if (Log.on) Log.log(Platform.class, "URL " + url + " is not well-formed"); - if (Log.on) Log.log(Platform.class, e); + if (Log.on) Log.info(Platform.class, "URL " + url + " is not well-formed"); + if (Log.on) Log.info(Platform.class, e); } - if (Log.on) Log.log(Platform.class, "newBrowserWindow, url = " + url); + if (Log.on) Log.info(Platform.class, "newBrowserWindow, url = " + url); platform._newBrowserWindow(url); } /** used to notify the user of very serious failures; usually used when logging is not working or unavailable */ public static void criticalAbort(String message) { - if (Log.on) Log.log(Platform.class, "Critical Abort:"); - if (Log.on) Log.log(Platform.class, message); + if (Log.on) Log.info(Platform.class, "Critical Abort:"); + if (Log.on) Log.info(Platform.class, message); platform._criticalAbort(message); } @@ -247,11 +247,11 @@ public abstract class Platform { if (alreadyDetectedProxy) return null; alreadyDetectedProxy = true; - if (Log.on) Log.log(Platform.class, "attempting environment-variable DNS proxy detection"); + if (Log.on) Log.info(Platform.class, "attempting environment-variable DNS proxy detection"); cachedProxyInfo = org.xwt.HTTP.Proxy.detectProxyViaManual(); if (cachedProxyInfo != null) return cachedProxyInfo; - if (Log.on) Log.log(Platform.class, "attempting " + platform.getClass().getName() + " proxy detection"); + if (Log.on) Log.info(Platform.class, "attempting " + platform.getClass().getName() + " proxy detection"); cachedProxyInfo = platform._detectProxy(); if (cachedProxyInfo != null) return cachedProxyInfo; diff --git a/src/org/xwt/Res.java b/src/org/xwt/Res.java index 32f812c..35f3b51 100644 --- a/src/org/xwt/Res.java +++ b/src/org/xwt/Res.java @@ -42,7 +42,7 @@ public abstract class Res extends JS { Template t = Template.getTemplate(addExtension(".xwt")); return t == null ? null : t.getStatic(); } catch (Exception e) { - Log.log(this, e); + Log.info(this, e); return null; } } diff --git a/src/org/xwt/SOAP.java b/src/org/xwt/SOAP.java index 190d8b4..2c4044f 100644 --- a/src/org/xwt/SOAP.java +++ b/src/org/xwt/SOAP.java @@ -201,8 +201,8 @@ class SOAP extends XMLRPC { sb.append(((Boolean)o).booleanValue() ? "1" : "0"); sb.append("\r\n"); } catch (IOException e) { - if (Log.on) Log.log(this, "caught IOException while attempting to send a ByteStream via SOAP"); - if (Log.on) Log.log(this, e); + if (Log.on) Log.info(this, "caught IOException while attempting to send a ByteStream via SOAP"); + if (Log.on) Log.info(this, e); throw new JSExn("caught IOException while attempting to send a ByteStream via SOAP"); } diff --git a/src/org/xwt/Scheduler.java b/src/org/xwt/Scheduler.java index d61ad55..f433858 100644 --- a/src/org/xwt/Scheduler.java +++ b/src/org/xwt/Scheduler.java @@ -70,11 +70,11 @@ public class Scheduler { } renderAll(); } catch (JSExn e) { - Log.log(Scheduler.class, "a JavaScript thread spawned with xwt.thread() threw an exception:"); - Log.log(Scheduler.class, e); + Log.info(Scheduler.class, "a JavaScript thread spawned with xwt.thread() threw an exception:"); + Log.info(Scheduler.class, e); } catch (Exception e) { - Log.log(Scheduler.class, "a Task threw an exception which was caught by the scheduler:"); - Log.log(Scheduler.class, e); + Log.info(Scheduler.class, "a Task threw an exception which was caught by the scheduler:"); + Log.info(Scheduler.class, e); } // if an Error is thrown it will cause the engine to quit } diff --git a/src/org/xwt/Surface.java b/src/org/xwt/Surface.java index e28dbcd..45221ba 100644 --- a/src/org/xwt/Surface.java +++ b/src/org/xwt/Surface.java @@ -142,7 +142,7 @@ public abstract class Surface extends PixelBuffer implements Scheduler.Task { try { root.putAndTriggerTraps("_Move", T); } catch (JSExn e) { - Log.log(Surface.class, "Exception thrown from Move message handler"); + Log.info(Surface.class, "Exception thrown from Move message handler"); Log.logJS(e); } if (!cursor.equals(oldcursor)) syncCursor(); @@ -194,11 +194,11 @@ public abstract class Surface extends PixelBuffer implements Scheduler.Task { /** Indicates that the Surface is no longer needed */ public final void dispose(boolean quitIfAllSurfacesGone) { - if (Log.on) Log.log(this, "disposing " + this); + if (Log.on) Log.info(this, "disposing " + this); allSurfaces.removeElement(this); _dispose(); if (allSurfaces.size() == 0) { - if (Log.on) Log.log(this, "exiting because last surface was destroyed"); + if (Log.on) Log.info(this, "exiting because last surface was destroyed"); System.exit(0); } } @@ -306,7 +306,7 @@ public abstract class Surface extends PixelBuffer implements Scheduler.Task { try { boxContainingMouse.putAndTriggerTraps(name, value); } catch (JSExn e) { - Log.log(Surface.class, "Exception thrown from "+name+" handler"); + Log.info(Surface.class, "Exception thrown from "+name+" handler"); Log.logJS(e); } finally { Platform.clipboardReadEnabled = false; diff --git a/src/org/xwt/Template.java b/src/org/xwt/Template.java index c9ac138..8d47f68 100644 --- a/src/org/xwt/Template.java +++ b/src/org/xwt/Template.java @@ -113,8 +113,8 @@ public class Template { } catch (JSExn e) { b.clear(b.VISIBLE); b.mark_for_repack(); - Log.log(Template.class, "WARNING: exception (below) thrown during application of template;"); - Log.log(Template.class, " setting visibility of target box to \"false\""); + Log.info(Template.class, "WARNING: exception (below) thrown during application of template;"); + Log.info(Template.class, " setting visibility of target box to \"false\""); Log.logJS(e); } } diff --git a/src/org/xwt/XMLRPC.java b/src/org/xwt/XMLRPC.java index 050199a..94a380e 100644 --- a/src/org/xwt/XMLRPC.java +++ b/src/org/xwt/XMLRPC.java @@ -119,8 +119,8 @@ class XMLRPC extends JS { objects.setElementAt(nd, objects.size() - 1); } catch (Exception e) { - if (Log.on) Log.log(this, "error parsing date : " + s); - if (Log.on) Log.log(this, e); + if (Log.on) Log.info(this, "error parsing date : " + s); + if (Log.on) Log.info(this, e); } case "member": Object memberValue = objects.elementAt(objects.size() - 1); @@ -150,8 +150,8 @@ class XMLRPC extends JS { public void characters(char[] ch, int start, int length) { try { content.write(ch, start, length); } catch (Exception e) { - if (Log.on) Log.log(this, "Exception in XMLRPC.content() -- this should never happen"); - if (Log.on) Log.log(this, e); + if (Log.on) Log.info(this, "Exception in XMLRPC.content() -- this should never happen"); + if (Log.on) Log.info(this, e); } } @@ -220,8 +220,8 @@ class XMLRPC extends JS { } sb.append("\n \n"); } catch (IOException e) { - if (Log.on) Log.log(this, "caught IOException while attempting to send a ByteStream via XML-RPC"); - if (Log.on) Log.log(this, e); + if (Log.on) Log.info(this, "caught IOException while attempting to send a ByteStream via XML-RPC"); + if (Log.on) Log.info(this, e); throw new JSExn("caught IOException while attempting to send a ByteStream via XML-RPC"); } @@ -313,9 +313,9 @@ class XMLRPC extends JS { final void call(final JS.UnpauseCallback callback, final JSArray args) { try { - if (Log.verbose) Log.log(this, "call to " + url + " : " + method); + if (Log.verbose) Log.info(this, "call to " + url + " : " + method); String request = buildRequest(args); - if (Log.verbose) Log.log(this, "send:\n" + request); + if (Log.verbose) Log.info(this, "send:\n" + request); InputStream is = http.POST("text/xml", request); BufferedReader br = new BufferedReader(new InputStreamReader(is)); if (tracker == null) tracker = new Hash(); diff --git a/src/org/xwt/XWT.java b/src/org/xwt/XWT.java index 71d3feb..25a05a3 100644 --- a/src/org/xwt/XWT.java +++ b/src/org/xwt/XWT.java @@ -185,7 +185,7 @@ public final class XWT extends JS { } } catch (RuntimeException e) { // FIXME: maybe JSExn should take a second argument, Exception - Log.log(this, "xwt."+name+"() threw: "+e); + Log.info(this, "xwt."+name+"() threw: "+e); throw new JSExn("invalid argument for xwt object method "+name+"()"); } @@ -298,8 +298,8 @@ public final class XWT extends JS { } catch (XML.Exn e) { throw new JSExn("error parsing XML: " + e.toString()); } catch (IOException e) { - if (Log.on) Log.log(this, "IO Exception while reading from file"); - if (Log.on) Log.log(this, e); + if (Log.on) Log.info(this, "IO Exception while reading from file"); + if (Log.on) Log.info(this, e); throw new JSExn("error reading from Resource"); } return obStack.size() >= 1 ? (JS)obStack.elementAt(0) : null; diff --git a/src/org/xwt/plat/AWT.java b/src/org/xwt/plat/AWT.java index 6843b12..2af3e80 100644 --- a/src/org/xwt/plat/AWT.java +++ b/src/org/xwt/plat/AWT.java @@ -22,12 +22,12 @@ public class AWT extends JVM { protected Surface _createSurface(Box b, boolean framed) { return new AWTSurface(b, framed); } protected void postInit() { - if (Log.on) Log.log(Platform.class, " color depth = " + + if (Log.on) Log.info(Platform.class, " color depth = " + Toolkit.getDefaultToolkit().getColorModel().getPixelSize() + "bpp"); } protected void _criticalAbort(String message) { - if (Log.on) Log.log(this, message); + if (Log.on) Log.info(this, message); final Dialog d = new Dialog(new Frame(), "XWT Cannot Continue"); d.setLayout(new BorderLayout()); TextArea ta = new TextArea("XWT cannot continue because:\n\n" + message, 10, 80); @@ -270,10 +270,10 @@ public class AWT extends JVM { public void setIcon(Picture i) { if (frame != null) frame.setIconImage(((AWTPicture)i).i); } public void _setSize(int width, int height) { window.setSize(width + (insets.left + insets.right), height + (insets.top + insets.bottom)); } public void setInvisible(boolean b) { window.setVisible(!b); } - protected void _setMinimized(boolean b) { if (Log.on) Log.log(this, "JDK 1.1 platforms cannot minimize or unminimize windows"); } + protected void _setMinimized(boolean b) { if (Log.on) Log.info(this, "JDK 1.1 platforms cannot minimize or unminimize windows"); } protected void _setMaximized(boolean b) { if (!b) { - if (Log.on) Log.log(this, "JDK 1.1 platforms cannot unmaximize windows"); + if (Log.on) Log.info(this, "JDK 1.1 platforms cannot unmaximize windows"); return; } window.setLocation(new Point(0, 0)); @@ -324,8 +324,8 @@ public class AWT extends JVM { // this is here to catch HeadlessException on jdk1.4 } catch (java.lang.UnsupportedOperationException e) { - if (Log.on) Log.log(this, "Exception thrown in AWTSurface$InnerFrame() -- this should never happen"); - if (Log.on) Log.log(this, e); + if (Log.on) Log.info(this, "Exception thrown in AWTSurface$InnerFrame() -- this should never happen"); + if (Log.on) Log.info(this, e); } insets = window.getInsets(); @@ -481,13 +481,13 @@ public class AWT extends JVM { PixelGrabber pg = new PixelGrabber(i, 0, 0, width, height, data, 0, width); pg.grabPixels(); if ((pg.getStatus() & ImageObserver.ABORT) != 0) - Log.log(this, "PixelGrabber reported an error while decoding JPEG image"); + Log.info(this, "PixelGrabber reported an error while decoding JPEG image"); p.width = width; p.height = height; p.data = data; } catch (Exception e) { - Log.log(this, "Exception caught while decoding JPEG image"); - Log.log(this, e); + Log.info(this, "Exception caught while decoding JPEG image"); + Log.info(this, e); } } } -- 1.7.10.4