|
Basic Logger 1.0-SNAPSHOT
Basic logger written in Java
|
Public Member Functions | |
| Logger (String name) | |
| Logger (String name, Formatter formatter) | |
| String | getName () |
| Formatter | getFormatter () |
| void | trace (String message, Object... args) |
| void | debug (String message, Object... args) |
| void | info (String message, Object... args) |
| void | warn (String message, Object... args) |
| void | error (String message, Object... args) |
Protected Member Functions | |
| synchronized void | print (@NotNull Level level, String message, @NotNull Object... args) throws IllegalArgumentException |
| abstract void | writeToOutput (String output) |
The Logger class serves as an abstract base for various types of loggers. It provides a framework for formatting and logging messages at different levels of severity and delegates the actual output mechanism to subclasses.
|
protected |
Writes a formatted log message to the designated output if the provided logging level is equal to or greater than the configured logging level.
| level | the logging level for the message; determines whether the message will be logged |
| message | the log message to be formatted and printed; cannot be null or blank |
| args | additional arguments to be substituted into the formatted log message |
| IllegalArgumentException | if the provided message is null or blank |
|
abstractprotected |
Outputs a constructed log message into an arbitrary output stream.
| output | output string |
Reimplemented in ge.edu.sangu.logger.ConsoleLogger, and ge.edu.sangu.logger.FileLogger.