- Timestamp:
- 2014-12-13T20:07:09+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r7801 r7802 36 36 import java.util.concurrent.Executors; 37 37 import java.util.concurrent.Future; 38 import java.util.logging.Handler; 39 import java.util.logging.Level; 40 import java.util.logging.LogRecord; 41 import java.util.logging.Logger; 38 42 39 43 import javax.swing.Action; … … 615 619 }); 616 620 FeatureAdapter.registerTranslationAdapter(I18n.getTranslationAdapter()); 621 FeatureAdapter.registerLoggingAdapter(new FeatureAdapter.LoggingAdapter() { 622 @Override 623 public Logger getLogger(String name) { 624 Logger logger = Logger.getAnonymousLogger(); 625 logger.setUseParentHandlers(false); 626 logger.setLevel(Level.ALL); 627 if (logger.getHandlers().length == 0) { 628 logger.addHandler(new Handler() { 629 @Override 630 public void publish(LogRecord record) { 631 String msg = MessageFormat.format(record.getMessage(), record.getParameters()); 632 if (record.getLevel().intValue() >= Level.SEVERE.intValue()) { 633 Main.error(msg); 634 } else if (record.getLevel().intValue() >= Level.WARNING.intValue()) { 635 Main.warn(msg); 636 } else if (record.getLevel().intValue() >= Level.INFO.intValue()) { 637 Main.info(msg); 638 } else if (record.getLevel().intValue() >= Level.FINE.intValue()) { 639 Main.debug(msg); 640 } else { 641 Main.trace(msg); 642 } 643 } 644 645 @Override 646 public void flush() { 647 } 648 649 @Override 650 public void close() throws SecurityException { 651 } 652 }); 653 } 654 return logger; 655 } 656 }); 617 657 618 658 if (initListener != null) {
Note:
See TracChangeset
for help on using the changeset viewer.