Changeset 6474 in josm for trunk/src/org/openstreetmap/josm/Main.java
- Timestamp:
- 2013-12-16T00:22:44+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r6471 r6474 212 212 */ 213 213 public static int logLevel = 3; 214 214 215 215 /** 216 216 * Prints an error message if logging is on. … … 223 223 System.err.println(tr("ERROR: {0}", msg)); 224 224 } 225 225 226 226 /** 227 227 * Prints a warning message if logging is on. … … 233 233 System.err.println(tr("WARNING: {0}", msg)); 234 234 } 235 235 236 236 /** 237 237 * Prints an informational message if logging is on. … … 243 243 System.out.println(tr("INFO: {0}", msg)); 244 244 } 245 245 246 246 /** 247 247 * Prints a debug message if logging is on. … … 253 253 System.out.println(tr("DEBUG: {0}", msg)); 254 254 } 255 255 256 256 /** 257 257 * Prints a formated error message if logging is on. Calls {@link MessageFormat#format} … … 264 264 error(MessageFormat.format(msg, objects)); 265 265 } 266 266 267 267 /** 268 268 * Prints a formated warning message if logging is on. Calls {@link MessageFormat#format} … … 274 274 warn(MessageFormat.format(msg, objects)); 275 275 } 276 276 277 277 /** 278 278 * Prints a formated informational message if logging is on. Calls {@link MessageFormat#format} … … 284 284 info(MessageFormat.format(msg, objects)); 285 285 } 286 286 287 287 /** 288 288 * Prints a formated debug message if logging is on. Calls {@link MessageFormat#format} … … 294 294 debug(MessageFormat.format(msg, objects)); 295 295 } 296 296 297 297 /** 298 298 * Prints an error message for the given Throwable. … … 303 303 error(getErrorMessage(t)); 304 304 } 305 305 306 306 /** 307 307 * Prints a warning message for the given Throwable. … … 312 312 warn(getErrorMessage(t)); 313 313 } 314 314 315 315 private static String getErrorMessage(Throwable t) { 316 316 StringBuilder sb = new StringBuilder(t.getClass().getName()); … … 318 318 if (msg != null) { 319 319 sb.append(": ").append(msg.trim()); 320 } 321 Throwable cause = t.getCause(); 322 if (cause != null && !cause.equals(t)) { 323 sb.append(". ").append(tr("Cause: ")).append(getErrorMessage(cause)); 320 324 } 321 325 return sb.toString();
Note:
See TracChangeset
for help on using the changeset viewer.