Revision: 2333
http://sourceforge.net/p/swingme/code/2333
Author: yuranet
Date: 2014-12-26 16:52:52 +0000 (Fri, 26 Dec 2014)
Log Message:
-----------
message needed for logging a throwable
Modified Paths:
--------------
SwingME/src/net/yura/mobile/gui/Animation.java
SwingME/src/net/yura/mobile/gui/DesktopPane.java
SwingME/src/net/yura/mobile/gui/Font.java
SwingME/src/net/yura/mobile/gui/Graphics2D.java
SwingME/src/net/yura/mobile/gui/Midlet.java
SwingME/src/net/yura/mobile/gui/components/Camera.java
SwingME/src/net/yura/mobile/gui/components/FileChooser.java
SwingME/src/net/yura/mobile/gui/components/OptionPane.java
SwingME/src/net/yura/mobile/gui/components/ScrollPane.java
SwingME/src/net/yura/mobile/gui/components/TextComponent.java
SwingME/src/net/yura/mobile/gui/layout/XHTMLLoader.java
SwingME/src/net/yura/mobile/gui/layout/XULLoader.java
SwingME/src/net/yura/mobile/gui/plaf/SynthLookAndFeel.java
SwingME/src/net/yura/mobile/io/BTDiscovery.java
SwingME/src/net/yura/mobile/io/BTService.java
SwingME/src/net/yura/mobile/io/ClipboardManager.java
SwingME/src/net/yura/mobile/io/FileUtil.java
SwingME/src/net/yura/mobile/io/LocationMonitor.java
SwingME/src/net/yura/mobile/io/ProtoFileUtil.java
SwingME/src/net/yura/mobile/io/RMSBackup.java
SwingME/src/net/yura/mobile/io/RMSUtil.java
SwingME/src/net/yura/mobile/io/SocketClient.java
SwingME/src/net/yura/mobile/logging/CallStack.java
SwingME/src/net/yura/mobile/logging/DesktopLogger.java
SwingME/src/net/yura/mobile/logging/FilesystemLogger.java
SwingME/src/net/yura/mobile/util/BlackBerryThumbLoader.java
SwingME/src/net/yura/mobile/util/ImageUtil.java
Modified: SwingME/src/net/yura/mobile/gui/Animation.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/Animation.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/gui/Animation.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -59,7 +59,7 @@
}
catch (Throwable th) {
//#debug info
- Logger.warn(th);
+ Logger.warn(null, th);
}
animation = null;
Modified: SwingME/src/net/yura/mobile/gui/DesktopPane.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/DesktopPane.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/gui/DesktopPane.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -252,8 +252,7 @@
}
catch (Throwable th) {
//#debug warn
- Logger.warn("Error in initialize: " + th.toString());
- Logger.error(th);
+ Logger.warn("Error in initialize", th);
}
// Set thread to maximum priority (smother animations and text input)
@@ -279,7 +278,7 @@
uiLock.wait();
}
catch (InterruptedException e) {
- Logger.info(e);
+ Logger.info(null, e);
}
continue; // Go to while (true) again
}
@@ -297,8 +296,7 @@
}
catch (Throwable th) {
//#debug warn
- Logger.warn("Error in animation: " + th.toString());
- Logger.error(th);
+ Logger.warn("Error in animation", th);
}
}
}
@@ -748,8 +746,7 @@
}
catch (Throwable th) {
//#debug warn
- Logger.warn("Error in paint: " + th.toString());
- Logger.error(th);
+ Logger.warn("Error in paint", th);
}
}
@@ -1335,8 +1332,7 @@
}
catch (Throwable th) {
//#debug warn
- Logger.warn("Error in KeyEvent: "+keyevent+" "+th.toString());
- Logger.error(th);
+ Logger.warn("Error in KeyEvent: " + keyevent, th);
}
}
@@ -1508,8 +1504,7 @@
}
catch (Throwable th) {
//#debug warn
- Logger.warn("Exception in pointerEvent: " + th.toString());
- Logger.error(th);
+ Logger.warn("Exception in pointerEvent", th);
}
}
Modified: SwingME/src/net/yura/mobile/gui/Font.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/Font.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/gui/Font.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -123,8 +123,8 @@
return getFont(is, characterImage, colors);
}
catch (IOException ex) {
- Logger.warn(ex);
- throw new RuntimeException();
+ Logger.warn("cant get font " + descriptor, ex);
+ throw new RuntimeException("cant get font " + descriptor);
}
}
@@ -219,7 +219,7 @@
//Logger.debug("FONT: Kerning for "+first+"-"+second+" = "+amount);
} catch (EOFException e) {
//#debug debug
- Logger.debug(e);
+ Logger.debug(null, e);
}
}
}
@@ -409,7 +409,7 @@
return f;
}
catch (IOException ex) {
- Logger.warn(ex);
+ Logger.warn("unable to load font: " + name, ex);
throw new RuntimeException("unable to load font: "+name);
}
Modified: SwingME/src/net/yura/mobile/gui/Graphics2D.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/Graphics2D.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/gui/Graphics2D.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -211,7 +211,7 @@
}
catch (Throwable e) {
//#debug debug
- Logger.warn(e);
+ Logger.warn("please use fake 3D api for scaled image drawing", e);
}
}
Modified: SwingME/src/net/yura/mobile/gui/Midlet.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/Midlet.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/gui/Midlet.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -234,7 +234,7 @@
platformRequest(url);
}
catch (Exception e) {
- Logger.warn(e);
+ Logger.warn("cant make request " + url + " " + arg, e);
throw new RuntimeException(e.toString());
}
}
@@ -251,10 +251,8 @@
getMidlet().platformRequest("tel:" + number);
}
catch (Exception e) {
- //#mdebug warn
- Logger.warn("can not call: " + number + " " + e.toString());
- Logger.warn(e);
- //#enddebug
+ //#debug warn
+ Logger.warn("can not call: " + number, e);
}
}
@@ -268,10 +266,8 @@
}
}
catch (Exception e) {
- //#mdebug warn
- Logger.warn("can not open url: " + url + " " + e.toString());
- Logger.warn(e);
- //#enddebug
+ //#debug warn
+ Logger.warn("can not open url: " + url, e);
}
}
@@ -281,10 +277,8 @@
Display.getDisplay(getMidlet()).vibrate(duration);
}
catch (Exception e) {
- //#mdebug warn
- Logger.warn("can not vibration " + e.toString());
- Logger.warn(e);
- //#enddebug
+ //#debug warn
+ Logger.warn("can not vibration", e);
}
}
@@ -297,7 +291,7 @@
}
catch (Exception ex) {
// as you called this yourself, you should not be throwing here
- Logger.warn(ex);
+ Logger.warn(null, ex);
throw new RuntimeException();
}
}
@@ -319,7 +313,7 @@
}
catch (Throwable th) {
//#debug warn
- Logger.warn(th);
+ Logger.warn("cant createImage " + name, th);
}
try {
Modified: SwingME/src/net/yura/mobile/gui/components/Camera.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/components/Camera.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/gui/components/Camera.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -297,12 +297,14 @@
// picture, to show the security prompt
if (cameraPermission < 0) {
photoData = null;
- } else {
+ }
+ else {
try {
actionListener.actionPerformed(actionCommand);
- } catch (Exception e) {
- Logger.warn(e);
}
+ catch (Exception e) {
+ Logger.warn("error calling " + actionListener + " " + actionCommand, e);
+ }
}
// From now on, we don't take any more "dummy pictures"
@@ -311,7 +313,7 @@
}
}
catch (Throwable e) {
- Logger.error(e);
+ Logger.error(null, e);
}
finally {
@@ -319,7 +321,7 @@
closePlayer();
}
catch (Exception e) {
- Logger.warn(e);
+ Logger.warn(null, e);
}
//#debug debug
Logger.debug("Camera Thread GONE.");
@@ -352,7 +354,7 @@
Logger.debug("getSnapshot: Trying " + encoding);
data = videoCtrl.getSnapshot(encoding);
} catch (Exception e) {
- Logger.warn(e);
+ Logger.warn("error encoding " + encoding, e);
}
if (data != null) {
@@ -545,7 +547,7 @@
}
catch (MediaException mex) {
//#debug debug
- Logger.debug(mex);
+ Logger.debug("cant set size " + dispW + "," + dispH, mex);
//resizing is not supported or the operation failed due to hardware or software limitations.
}
@@ -584,7 +586,7 @@
}
}
catch (Exception e) {
- Logger.warn(e);
+ Logger.warn("error " + encoding + " " + prefix, e);
}
return 0;
}
@@ -609,7 +611,7 @@
}
catch (RecordStoreException ex) {
// this is just a best effort to persist dimensions to rms
- Logger.info(ex);
+ Logger.info("error setting " + encodingString, ex);
}
}
@@ -624,7 +626,7 @@
}
catch (Exception ex) {
// again just a best effort to look up dimensions
- Logger.info(ex);
+ Logger.info("error getting", ex);
}
return null;
}
Modified: SwingME/src/net/yura/mobile/gui/components/FileChooser.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/components/FileChooser.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/gui/components/FileChooser.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -312,7 +312,7 @@
Thread.sleep(0);
}
catch (InterruptedException ex) {
- Logger.info(ex);
+ Logger.info(null, ex);
}
}
@@ -408,9 +408,7 @@
}
catch(Throwable t) {
//#debug warn
- Logger.warn("faital error in FileChooser thread");
- //#debug error
- Logger.error(t);
+ Logger.warn("faital error in FileChooser thread", t);
}
}
Modified: SwingME/src/net/yura/mobile/gui/components/OptionPane.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/components/OptionPane.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/gui/components/OptionPane.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -395,7 +395,7 @@
}
}
catch(Throwable t) {
- Logger.error(t);
+ Logger.error(null, t);
}
}
Modified: SwingME/src/net/yura/mobile/gui/components/ScrollPane.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/components/ScrollPane.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/gui/components/ScrollPane.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -821,7 +821,7 @@
}
catch(Throwable e) {
//#debug info
- Logger.info(e);
+ Logger.info(null, e);
// we use this instead of using brackets as blackberry build script does not like brackets in catch blocks
ScrollPane.dragScrollPane = ScrollPane.dragScrollPane == this?null:ScrollPane.dragScrollPane;
Modified: SwingME/src/net/yura/mobile/gui/components/TextComponent.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/components/TextComponent.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/gui/components/TextComponent.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -383,7 +383,7 @@
return true;
}
else if (keyEvent.isDownKey(KeyEvent.KEY_EDIT)) { // Ctrl is pressed
- if (keyEvent.isDownKey(22)) {// TODO no idea why 22
+ if (keyEvent.isDownKey(22) || keyEvent.isDownKey(118)) { // V is the 22nd char of the alphabet
paste();
}
// TODO support other things like CUT and COPY and UNDO
Modified: SwingME/src/net/yura/mobile/gui/layout/XHTMLLoader.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/layout/XHTMLLoader.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/gui/layout/XHTMLLoader.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -72,7 +72,7 @@
endInlineSection();
}
catch(Exception ex) {
- Logger.warn(ex);
+ Logger.warn("cant load " + resultsStream + " " + actionL, ex);
}
}
@@ -85,7 +85,7 @@
read(parser);
}
catch(Exception ex) {
- Logger.warn(ex);
+ Logger.warn("cant set " + pane + " " + string, ex);
}
}
Modified: SwingME/src/net/yura/mobile/gui/layout/XULLoader.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/layout/XULLoader.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/gui/layout/XULLoader.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -795,7 +795,7 @@
return new Icon(value);
}
catch (Exception ex) {
- Logger.warn(ex);
+ Logger.warn("cant load " + value, ex);
return null;
}
}
Modified: SwingME/src/net/yura/mobile/gui/plaf/SynthLookAndFeel.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/plaf/SynthLookAndFeel.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/gui/plaf/SynthLookAndFeel.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -516,7 +516,7 @@
fsize = -Integer.parseInt(fontSize);
}
catch(Exception ex) {
- Logger.warn(ex);
+ Logger.warn("error with " + fontSize, ex);
}
}
}
Modified: SwingME/src/net/yura/mobile/io/BTDiscovery.java
===================================================================
--- SwingME/src/net/yura/mobile/io/BTDiscovery.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/io/BTDiscovery.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -28,7 +28,7 @@
return true;
}
} catch (IOException ex) {
- Logger.warn(ex);
+ Logger.warn("cant start " + accessCode, ex);
}
return false;
}
@@ -43,7 +43,7 @@
}
}
catch (Throwable t) {
- Logger.error(t);
+ Logger.error("error " + device + " " + deviceClass, t);
}
}
@@ -55,7 +55,7 @@
}
}
catch (Throwable t) {
- Logger.error(t);
+ Logger.error("error" + transId, t);
}
}
public void inquiryCompleted(int discoveryType) {
@@ -63,7 +63,7 @@
handleInquiryCompleted();
}
catch (Throwable t) {
- Logger.error(t);
+ Logger.error("error" + discoveryType, t);
}
}
public void serviceSearchCompleted(int transId, int responseCode) {
Modified: SwingME/src/net/yura/mobile/io/BTService.java
===================================================================
--- SwingME/src/net/yura/mobile/io/BTService.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/io/BTService.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -42,7 +42,7 @@
bRegistered = true;
}
catch (Exception ex) {
- Logger.warn(ex);
+ Logger.warn("cant reg " + aUuid, ex);
}
}
return bRegistered;
@@ -60,7 +60,7 @@
bRegistered = true;
}
catch (Exception ex) {
- Logger.warn(ex);
+ Logger.warn("cant reg " + aUuid + " " + serviceName, ex);
}
}
return bRegistered;
Modified: SwingME/src/net/yura/mobile/io/ClipboardManager.java
===================================================================
--- SwingME/src/net/yura/mobile/io/ClipboardManager.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/io/ClipboardManager.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -78,7 +78,7 @@
midlet.platformRequest("clipboard://put/"+text);
}
catch(Exception ex) {
- Logger.warn(ex);
+ Logger.warn("cant put " + text, ex);
}
}
}
Modified: SwingME/src/net/yura/mobile/io/FileUtil.java
===================================================================
--- SwingME/src/net/yura/mobile/io/FileUtil.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/io/FileUtil.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -51,7 +51,7 @@
}
catch(IOException ioe) {
//#debug info
- Logger.info(ioe);
+ Logger.info("cant close " + fc, ioe);
}
}
}
@@ -101,10 +101,8 @@
}
catch(Exception ex) {
- //#mdebug debug
- Logger.warn("error moving dir: "+ex.toString());
- Logger.warn(ex);
- //#enddebug
+ //#debug debug
+ Logger.warn("error moving dir", ex);
}
return files;
@@ -227,7 +225,7 @@
}
}
catch(Exception e) {
- Logger.warn(e);
+ Logger.warn("cant get size " + fileName, e);
}
return fileSize;
}
@@ -249,7 +247,7 @@
}
}
catch(Exception e) {
- Logger.warn(e);
+ Logger.warn("error " + fileName, e);
}
//Close the file connection
@@ -277,7 +275,7 @@
return false;
}
catch (Exception e) {
- Logger.info(e);
+ Logger.info("error " + filePath, e);
return false;
}
}
@@ -304,7 +302,7 @@
}
}
catch(Exception e) {
- Logger.warn(e);
+ Logger.warn("cant make " + dirName, e);
}
return false;
}
@@ -328,7 +326,7 @@
en = fc.list();
}
catch (Exception ex) {
- Logger.info(ex);
+ Logger.info("error " + dir, ex);
}
return en;
@@ -353,7 +351,7 @@
}
}
catch(Exception e) {
- Logger.warn(e);
+ Logger.warn("cant del " + path, e);
}
}
@@ -391,14 +389,14 @@
}
}
catch(Exception e) {
- Logger.warn(e);
+ Logger.warn("cant read " + fileName + " " + startPos + " " + length, e);
}
return null;
}
/**
* Write the data specified in a array out to the native filesystem.
- * @param fileName full file name
+ * @param fullname full file name
* @param append indicates whether to append or create a new file
* @param fileStartPos start position of file
* @param data byte[]
@@ -412,7 +410,7 @@
/**
* Write the data specified in a array out to the native filesystem.
- * @param fileName full file name
+ * @param fullname full file name
* @param append indicates whether to append or create a new file
* @param deleteExisting indicates whether to delete the existing file if there is one
* @param fileStartPos start position of file
@@ -458,7 +456,7 @@
catch(Exception e) {
dstname = null;
- Logger.warn(e);
+ Logger.warn("error " + fullname + " " + append + " " + deleteExisting + " " + fileStartPos + " " + dataStartPos + " " + dataLength, e);
}
finally {
close(os);
@@ -496,11 +494,11 @@
* copy file to other dir
* sometimes Attachment.fileName did not equal local file name
* @param srcfileName original filename
- * @param srcFullPath src path
+ * @param srcFullName src path
* @param desFullPath target dir name
* @return if success return true;
*/
- public static boolean copyFile(String attachmentName,String srcFullName,String desFullPath) {
+ public static boolean copyFile(String srcfileName,String srcFullName,String desFullPath) {
int COPY_BLOCK_SIZE=10*1024;
FileConnection dst = null;
@@ -509,11 +507,11 @@
OutputStream dos = null;
boolean writesucc = false;
try {
- src=(FileConnection)(Connector.open(srcFullName,Connector.READ_WRITE));
+ src = (FileConnection) Connector.open(srcFullName, Connector.READ_WRITE);
if( src != null && src.exists() ) {
- dst=(FileConnection)(Connector.open(desFullPath + attachmentName,Connector.READ_WRITE));
+ dst = (FileConnection) Connector.open(desFullPath + srcfileName, Connector.READ_WRITE);
if( dst.exists() ) {
- dst = findAvailableFile(desFullPath + attachmentName);
+ dst = findAvailableFile(desFullPath + srcfileName);
}
else {
dst.create();
@@ -533,7 +531,7 @@
catch (Exception e) {
writesucc = false;
- Logger.warn(e);
+ Logger.warn("copy error " + srcfileName + " " + srcFullName + " " + desFullPath, e);
}
finally {
close(dis);
@@ -554,7 +552,7 @@
FileUtil.writeFile(destination, false, true, 0, sourceData, 0, sourceData.length);
}
catch(Exception e) {
- Logger.warn(e);
+ Logger.warn("copy error " + source + " " + destination, e);
}
}
Modified: SwingME/src/net/yura/mobile/io/LocationMonitor.java
===================================================================
--- SwingME/src/net/yura/mobile/io/LocationMonitor.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/io/LocationMonitor.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -100,13 +100,14 @@
private int getPropertyIndex(String[] properties) {
for (int index=0;index < properties.length;index++) {
+ String name = properties[index];
try {
- String property = System.getProperty(properties[index]);
+ String property = System.getProperty(name);
if ((property != null) && (property.length() > 0))
return index;
}
catch (Exception t) {
- Logger.warn(t);
+ Logger.warn("cant get " + name, t);
}
}
return -1;
@@ -166,7 +167,7 @@
}
}
catch (Exception t) {
- Logger.warn(t);
+ Logger.warn(null, t);
}
return null;
}
@@ -209,7 +210,7 @@
}
}
catch(Throwable t) {
- Logger.error(t);
+ Logger.error(null, t);
}
}
Modified: SwingME/src/net/yura/mobile/io/ProtoFileUtil.java
===================================================================
--- SwingME/src/net/yura/mobile/io/ProtoFileUtil.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/io/ProtoFileUtil.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -25,7 +25,7 @@
return (int)file.fileSize();
}
catch(Exception ex) {
- Logger.warn(ex);
+ Logger.warn("cant get size " + obj, ex);
return 0;
}
}
Modified: SwingME/src/net/yura/mobile/io/RMSBackup.java
===================================================================
--- SwingME/src/net/yura/mobile/io/RMSBackup.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/io/RMSBackup.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -75,10 +75,8 @@
// we can not read this record, lets remove it from the store!
recordStore.deleteRecord(id);
- //#mdebug warn
- Logger.warn("Error loading RMS: "+rmsName+" record id="+id);
- Logger.warn(ex);
- //#enddebug
+ //#debug warn
+ Logger.warn("Error loading RMS: " + rmsName + " record id=" + id, ex);
}
}
@@ -105,7 +103,7 @@
start();
}
catch(IllegalThreadStateException ex) {
- Logger.info(ex);
+ Logger.info(null, ex);
} // TODO, find a better way
}
}
Modified: SwingME/src/net/yura/mobile/io/RMSUtil.java
===================================================================
--- SwingME/src/net/yura/mobile/io/RMSUtil.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/io/RMSUtil.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -24,10 +24,8 @@
RecordStore.deleteRecordStore(name);
}
catch (Exception ex) {
- //#mdebug info
- Logger.info("can not del RMS, this should not happen");
- Logger.warn(ex);
- //#enddebug
+ //#debug info
+ Logger.info("can not del RMS, this should not happen", ex);
}
// Open the record store.
Modified: SwingME/src/net/yura/mobile/io/SocketClient.java
===================================================================
--- SwingME/src/net/yura/mobile/io/SocketClient.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/io/SocketClient.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -111,8 +111,9 @@
if(!isRunning()) return;
+ String serv = null;
try {
- String serv = getNextServer();
+ serv = getNextServer();
retryCount++;
//#debug info
@@ -139,7 +140,7 @@
updateState(DISCONNECTED);
//#debug info
- Logger.info(s);
+ Logger.info("cant connect " + serv, s);
securityException();
return;
@@ -153,7 +154,7 @@
Logger.info(x.toString()); // we do not want to print the full stack trace as this is not a serious error
}
else {
- Logger.info(x);
+ Logger.info("cant connect " + serv, x);
}
//#enddebug
@@ -166,7 +167,7 @@
}
catch (Exception e){
//#debug info
- Logger.info(e);
+ Logger.info(null, e);
}
}
@@ -191,7 +192,7 @@
}
catch (InterruptedException ex) {
//#debug info
- Logger.info(ex);
+ Logger.info(null, ex);
}
}
}
@@ -232,10 +233,8 @@
}
catch(Exception ex) {
// THIS WILL ONLY HAPPEN IF YOU GET A DISCONNECT DURING A SEND
- //#mdebug info
- Logger.info("[SocketClient] Exception during a write to socket");
- Logger.info(ex);
- //#enddebug
+ //#debug info
+ Logger.info("[SocketClient] Exception during a write to socket", ex);
// move this and any queued objects to offline inbox
addToOfflineBox(object, true);
Modified: SwingME/src/net/yura/mobile/logging/CallStack.java
===================================================================
--- SwingME/src/net/yura/mobile/logging/CallStack.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/logging/CallStack.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -57,7 +57,7 @@
catch(RecordStoreException e)
{
//#debug debug
- Logger.warn(e);
+ Logger.warn(null, e);
}
return false;
}
@@ -74,7 +74,7 @@
catch(RecordStoreException e)
{
//#debug debug
- Logger.warn(e);
+ Logger.warn(null, e);
}
return null;
}
@@ -95,7 +95,7 @@
catch(Exception e)
{
//#debug debug
- Logger.warn(e);
+ Logger.warn("cant write to " + dir, e);
}
}
@@ -110,7 +110,7 @@
catch(RecordStoreException e)
{
//#debug debug
- Logger.warn(e);
+ Logger.warn(null, e);
}
}
@@ -307,7 +307,7 @@
catch(RecordStoreException e)
{
//#debug debug
- Logger.warn(e);
+ Logger.warn(null, e);
}
}
}
Modified: SwingME/src/net/yura/mobile/logging/DesktopLogger.java
===================================================================
--- SwingME/src/net/yura/mobile/logging/DesktopLogger.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/logging/DesktopLogger.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -84,7 +84,7 @@
}
}
catch(Throwable th) {
- Logger.error(th);
+ Logger.error("cant log " + message, th);
}
}
}
Modified: SwingME/src/net/yura/mobile/logging/FilesystemLogger.java
===================================================================
--- SwingME/src/net/yura/mobile/logging/FilesystemLogger.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/logging/FilesystemLogger.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -41,32 +41,29 @@
}
log.println(toString(level) + message);
} catch (IOException e) {
- logger.log(e, WARN);
+ logger.log(null, e, WARN);
}
}
- protected synchronized void log(Throwable throwable, int level) {
- logger.log(throwable, level);
+ protected synchronized void log(String error, Throwable throwable, int level) {
+ logger.log(error, throwable, level);
try {
if (log == null) {
open();
}
String stacktrace = CallStack.getStacktrace();
- log.print(toString(level) + (stacktrace.length()==0 ? throwable.toString() + "\n" : stacktrace));
+ log.print(toString(level) + (error == null ? "" : error + " ") + (stacktrace.length() == 0 ? throwable.toString() + "\n" : stacktrace));
} catch (IOException e) {
- logger.log(e, WARN);
+ logger.log(null, e, WARN);
}
}
- public static void close()
- {
- try
- {
+ public static void close() {
+ try {
file.close();
}
- catch(IOException e)
- {
- Logger.warn(e);
+ catch(IOException e) {
+ Logger.warn(null, e);
}
}
}
Modified: SwingME/src/net/yura/mobile/util/BlackBerryThumbLoader.java
===================================================================
--- SwingME/src/net/yura/mobile/util/BlackBerryThumbLoader.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/util/BlackBerryThumbLoader.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -71,10 +71,8 @@
*/
}
catch (Exception ex) {
- //#mdebug debug
- System.err.println("error "+ex+" "+img+" "+(img!=null?img.length:-1));
- Logger.warn(ex);
- //#enddebug
+ //#debug debug
+ Logger.warn("error " + img + " " + (img != null ? img.length : -1), ex);
}
Modified: SwingME/src/net/yura/mobile/util/ImageUtil.java
===================================================================
--- SwingME/src/net/yura/mobile/util/ImageUtil.java 2014-12-26 15:54:07 UTC (rev 2332)
+++ SwingME/src/net/yura/mobile/util/ImageUtil.java 2014-12-26 16:52:52 UTC (rev 2333)
@@ -117,10 +117,8 @@
return Image.createImage(is);
}
catch (Throwable err) {
- //#mdebug warn
- Logger.warn("failed to load image for: "+filename+" "+err.toString());
- Logger.warn(err);
- //#enddebug
+ //#debug warn
+ Logger.warn("failed to load image for: " + filename, err);
return null;
}
finally {
@@ -151,10 +149,8 @@
return getThumbFromFile(dis);
}
catch (Throwable err) {
- //#mdebug warn
- Logger.warn("failed to load thumb for: "+fileName+" "+err.toString());
- Logger.warn(err);
- //#enddebug
+ //#debug warn
+ Logger.warn("failed to load thumb for: " + fileName, err);
return null;
}
finally {
@@ -229,7 +225,7 @@
}
}
catch (Throwable e) {
- Logger.error(e);
+ Logger.error(null, e);
}
return image;
@@ -366,7 +362,7 @@
return getScaledImage(Image.createImage (is),cW,cH);
}
catch(Exception ex){
- Logger.warn(ex);
+ Logger.warn(null, ex);
}
return null;
}
@@ -385,13 +381,14 @@
if ( dispImage == null ) {
return Image.createImage ( encodedImage, 0, encodedImage.length );
}
- } catch( Exception e ) {
+ }
+ catch(Exception e) {
System.gc ();
try {
return getJPEGthumb ( encodedImage );
}
- catch( Exception e2 ) {
- Logger.warn(e2);
+ catch(Exception e2) {
+ Logger.warn(null, e2);
}
}
return null;
@@ -501,8 +498,8 @@
saveImage(image, outputStream, "png");
}
catch(Exception ex2) {
- Logger.warn(ex);
- Logger.warn(ex2);
+ Logger.warn(null, ex);
+ Logger.warn(null, ex2);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|