1 package net.sf.openrocket.logging;
4 * The logging level. The natural order of the LogLevel orders the levels
5 * from highest priority to lowest priority. Comparisons of the relative levels
6 * should be performed using the methods {@link #atLeast(LogLevel)},
7 * {@link #moreThan(LogLevel)} and {@link #compareTo(LogLevel)}.
9 * A description of the level can be obtained using {@link #toString()}.
11 * @author Sampo Niskanen <sampo.niskanen@iki.fi>
13 public enum LogLevel {
15 * Level for indicating a bug or error condition noticed in the software or JRE.
16 * No ERROR level events _should_ occur while running the program.
20 * Level for indicating error conditions or untypical events that can occur during
21 * normal operation (errors while loading files, weird computation results etc).
25 * Level for logging user actions (adding and modifying components, running
30 * Level for indicating general level actions the software is performing and
31 * other notable events during execution (dialogs shown, simulations run etc).
35 * Level for indicating mid-results and other debugging information. No debug
36 * logging should be performed in performance-intensive places to avoid slowing
37 * the system. On the other hand for example cached results should be logged.
42 /** The maximum length of a level textual description */
43 public static final int LENGTH;
46 for (LogLevel l: LogLevel.values()) {
47 length = Math.max(length, l.toString().length());
53 * Return true if this log level is of a priority at least that of
56 public boolean atLeast(LogLevel level) {
57 return this.compareTo(level) <= 0;
61 * Return true if this log level is of a priority greater than that of
64 public boolean moreThan(LogLevel level) {
65 return this.compareTo(level) < 0;