CLDR Ticket #8581(accepted tools)
Move logging into utilities
Reported by: | mark | Owned by: | mark |
---|---|---|---|
Component: | survey | Data Locale: | |
Phase: | rc | Review: | |
Weeks: | Data Xpath: | ||
Xref: |
Description
I was thinking of having adding methods that could be called in lower-level functions but that could be replaced in the production ST for debugging problems that only show up there. Something like the following.
We do have SurveyLog , but that is in the Web stuff.
CLDRConfig
static abstract class Logger {
abstract public void log(Exception e, Object... parameters);
}
public static final Logger DEFAULT_LOGGER = new Logger() {
public void log(Exception e, Object... parameters) {
if (parameters.length > 0) {
System.err.println(Arrays.asList(parameters));
}
if (e != null) {
e.printStackTrace();
}
}
};
Logger logger = DEFAULT_LOGGER;
/
- Log an exception, where the Survey tool can modify this to store more information,
- such as when events happened, and so on.
- It can also manage the storage, so that the logs don't overflow
- (eg just retaining a few exceptions that happen at
- the same place, or dropping old values.)
- @param e - exception, may be null.
- @param parameters - may be empty. Examples: the current locale, path, and value. */
public void log(Exception e, Object... parameters) {
logger.log(e, parameters);
}
Attachments
Change History
comment:1 Changed 3 years ago by emmons
- Status changed from new to accepted
- Cc srl added
- Component changed from unknown to survey
- Priority changed from assess to medium
- Phase changed from dsub to rc
- Milestone changed from UNSCH to 29
- Owner changed from anybody to mark
- Type changed from unknown to tools