- Timestamp:
- 07/28/07 05:44:23 PM (18 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/LogicMail/src/org/logicprobe/LogicMail/util/Connection.java
r135 r136 69 69 import net.rim.device.api.system.EventLogger; 70 70 import org.logicprobe.LogicMail.AppInfo; 71 import org.logicprobe.LogicMail.conf.GlobalConfig; 72 import org.logicprobe.LogicMail.conf.MailSettings; 71 73 72 74 /** … … 95 97 private StreamConnection socket; 96 98 private String localAddress; 99 private GlobalConfig globalConfig; 97 100 protected InputStream input; 98 101 protected OutputStream output; … … 126 129 this.output = null; 127 130 this.socket = null; 131 this.globalConfig = MailSettings.getInstance().getGlobalConfig(); 128 132 } 129 133 … … 266 270 */ 267 271 if (s.length() == 0) { 268 EventLogger.logEvent(AppInfo.GUID, "[SEND]".getBytes(), EventLogger.DEBUG_INFO); 272 if(globalConfig.getConnDebug()) { 273 EventLogger.logEvent(AppInfo.GUID, "[SEND]".getBytes(), EventLogger.DEBUG_INFO); 274 } 269 275 270 276 output.write(CRLF, 0, 2); … … 286 292 } 287 293 288 EventLogger.logEvent(AppInfo.GUID, ("[SEND] " + s.substring(i, j)).getBytes(), EventLogger.DEBUG_INFO); 294 if(globalConfig.getConnDebug()) { 295 EventLogger.logEvent(AppInfo.GUID, ("[SEND] " + s.substring(i, j)).getBytes(), EventLogger.DEBUG_INFO); 296 } 289 297 290 298 /** … … 319 327 int length = bytes.length; 320 328 321 EventLogger.logEvent(AppInfo.GUID, ("[SEND RAW]\r\n" + s).getBytes(), EventLogger.DEBUG_INFO); 322 329 if(globalConfig.getConnDebug()) { 330 EventLogger.logEvent(AppInfo.GUID, ("[SEND RAW]\r\n" + s).getBytes(), EventLogger.DEBUG_INFO); 331 } 332 323 333 output.write(bytes, 0, bytes.length); 324 334 … … 389 399 */ 390 400 if (actual == -1) { 401 EventLogger.logEvent(AppInfo.GUID, "Unable to read from socket, closing connection".getBytes(), EventLogger.INFORMATION); 391 402 try { 392 403 close(); … … 442 453 } 443 454 444 EventLogger.logEvent(AppInfo.GUID, ("[RECV] " + resultBuffer.toString()).getBytes(), EventLogger.DEBUG_INFO); 455 if(globalConfig.getConnDebug()) { 456 EventLogger.logEvent(AppInfo.GUID, ("[RECV] " + resultBuffer.toString()).getBytes(), EventLogger.DEBUG_INFO); 457 } 445 458 446 459 return resultBuffer.toString();
