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

Public Member Functions

 FileLogger (String name, String filePath)
Public Member Functions inherited from ge.edu.sangu.logger.Logger
 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

void writeToOutput (String output)
Protected Member Functions inherited from ge.edu.sangu.logger.Logger
synchronized void print (@NotNull Level level, String message, @NotNull Object... args) throws IllegalArgumentException

Detailed Description

FileLogger is a concrete implementation of the Logger class responsible for logging messages to a specified file. This class provides functionality for persistent logging by appending log entries to a file located at a given file path.

Each log message is formatted using the Formatter inherited from the Logger class before being written to the file. If the file does not exist, it will be created. If an error occurs while writing to the file, a RuntimeException is thrown.

Member Function Documentation

◆ writeToOutput()

void ge.edu.sangu.logger.FileLogger.writeToOutput ( String output)
protected

Outputs a constructed log message into an arbitrary output stream.

Parameters
outputoutput string

Reimplemented from ge.edu.sangu.logger.Logger.


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