Issue a message to the log but only if the same message has not been logged already in the same GATE session. This is intended for explanations or warnings that should not be repeated every time the same situation occurs. @param logger - the logger instance to use @param level - a Log4J severity l
(org.apache.log4j.Logger logger, org.apache.log4j.Level level, String message)
| 763 | * @deprecated Log4J support will be removed in future, please use SLF4J |
| 764 | */ |
| 765 | @Deprecated |
| 766 | public static void logOnce (org.apache.log4j.Logger logger, org.apache.log4j.Level level, String message) { |
| 767 | if(!alreadyLoggedMessages.contains(message)) { |
| 768 | |
| 769 | try { |
| 770 | logger.log(level, message); |
| 771 | } catch (Exception e) { |
| 772 | System.err.println( |
| 773 | "Failed to access logger through deprecated gate.Utils.logOnce method.\n"+ |
| 774 | "Log message was: " + message); |
| 775 | } |
| 776 | |
| 777 | alreadyLoggedMessages.add(message); |
| 778 | } |
| 779 | } |
| 780 | |
| 781 | /** |
| 782 | * Issue a message to the log but only if the same message has not |