Class TextOrGUILogger
java.lang.Object
com.xinapse.util.logging.TextOrGUILogger
A Logger that logs to either:
- System.out (for FINE and FINER messages) and System.err (for WARNING and SEVERE messages), for command-line programs, or
- A pop-up error console, for GUI programs. Only SEVERE messages are logged; all others are ignored.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LoggerA Logger that logs only SEVERE (error) messages to the terminal or the pop-up error console. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcontinueProgressiveOutput(Logger logger, String message) Shows some more progresive output.static voidendProgressBar(Logger logger) Sets the progress bar to 100%, and ends the progress bar.static voidendProgressBar(Logger logger, String finalMessage) Sets the progress bar to 100%, and ends the progress bar with a final message.static voidfinishProgressiveOutput(Logger logger) Finishes the progresive output.static voidfinishProgressiveOutput(Logger logger, String finalMessage) Finishes the progresive output with a final message.static LoggerReturns a TextOrGUILogger with the given name.static voidRun the self-text on this class.static voidsetProgress(Logger logger, int step) Sets the amount of progress shown by the progress bar.static voidstartProgressBar(Logger logger, String initialMessage, int nSteps) Starts showing a progress bar if the logging level is Finer.static voidstartProgressiveOutput(Logger logger, String initialMessage) Starts showing some progresive output.static voidstartTwiddler(Logger logger, String initialMessage) Starts a Twiddler.static voidstopTwiddler(Logger logger) Stops the twidder.static voidstopTwiddler(Logger logger, String finalMessage) Stops the twidder with a final message.static voidTwiddles the twidder.
-
Field Details
-
ERROR_ONLY_LOGGER
A Logger that logs only SEVERE (error) messages to the terminal or the pop-up error console. Give the logger a name that differentiates it from the logger created by the program Jim, otherwise logging messages will be duplicated by the 2 loggers.
-
-
Method Details
-
getLogger
-
startProgressBar
Starts showing a progress bar if the logging level is Finer.- Parameters:
logger- the Logger, which must be TextOrGUILogger.initialMessage- the initial message to show before the bar.nSteps- the number of progress steps to reach 100%.
-
setProgress
Sets the amount of progress shown by the progress bar.- Parameters:
logger- the Logger, which must be TextOrGUILogger.step- the step number out the of the total number of steps.
-
endProgressBar
Sets the progress bar to 100%, and ends the progress bar.- Parameters:
logger- the Logger, which must be TextOrGUILogger.
-
endProgressBar
-
startTwiddler
-
twiddle
Twiddles the twidder.- Parameters:
logger- the Logger, which must be a TextOrGUILogger.
-
stopTwiddler
Stops the twidder.- Parameters:
logger- the Logger, which must be a TextOrGUILogger.
-
stopTwiddler
-
startProgressiveOutput
-
continueProgressiveOutput
-
finishProgressiveOutput
Finishes the progresive output.- Parameters:
logger- the Logger, which must be a TextOrGUILogger.
-
finishProgressiveOutput
-
main
-