Basic Logger 1.0-SNAPSHOT
Basic logger written in Java
Loading...
Searching...
No Matches
ge.edu.sangu.logger.Logger Class Referenceabstract
Inheritance diagram for ge.edu.sangu.logger.Logger:
ge.edu.sangu.logger.ConsoleLogger ge.edu.sangu.logger.FileLogger

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)

Detailed Description

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.

Author
v.laluashvili

Member Function Documentation

◆ print()

synchronized void ge.edu.sangu.logger.Logger.print ( @NotNull Level level,
String message,
@NotNull Object... args ) throws IllegalArgumentException
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.

Parameters
levelthe logging level for the message; determines whether the message will be logged
messagethe log message to be formatted and printed; cannot be null or blank
argsadditional arguments to be substituted into the formatted log message
Exceptions
IllegalArgumentExceptionif the provided message is null or blank

◆ writeToOutput()

abstract void ge.edu.sangu.logger.Logger.writeToOutput ( String output)
abstractprotected

Outputs a constructed log message into an arbitrary output stream.

Parameters
outputoutput string

Reimplemented in ge.edu.sangu.logger.ConsoleLogger, and ge.edu.sangu.logger.FileLogger.


The documentation for this class was generated from the following file:
  • src/main/java/ge/edu/sangu/logger/Logger.java