/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License.
*/
/** Track events that occur in the module system abstractly. * A concrete implementation can provide localized messages * for these, notify the user visually, track performance, etc. * Only events relevant to the user or to performance need to * be logged; detailed low-level descriptions of what is * happening can simply be logged to the ErrorManager. * @author Jesse Glick
*/ publicabstractclass Events {
/** Constructor for subclasses to use. */ protected Events() {
}
/** Log an event. * You must pass a fixed event type string, and a list * of arguments (meaning varies according to event type). * Note that the event type string must be the exact String * listed as the constant in this class, not a copy.
*/ publicfinalvoid log(String message, Object ... args) { if (Util.err.isLoggable(Level.FINE) &&
message != PERF_START && message != PERF_TICK && message != PERF_END) {
Util.err.fine("EVENT -> " + message + " " + Arrays.asList(args));
} try {
logged(message, args);
} catch (RuntimeException re) { // If there is any problem logging, it should not kill the system // which called the logger.
Util.err.log(Level.WARNING, null, re);
}
}
/** Report an event.
*/ protectedabstractvoid logged(String message, Object[] args);
}
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.