The LogDumperLib supports clients to add logs asynchronously and doesn't block the client application.
Usage:
// Create LogDumper
LogDumper logDumper = LogDumperImpl.getDefaultLogger();
// Register Application
logDumper.registerApp("Test-Application");
// Add logs
logDumper.info("Test Log");
logDumper.error("Error Log");
Clients have been provided a LogDumper Interface and can use the same for registering the application and adding logs.
The logger instance is a singleton as only once such logger should be there for a particular cleint.
While generating a log, the library calls the logging method in async mode that takes an exclusive lock on the client log file before appending the log.
LogDumper Interface:
The interface the client should use and defines the required methods to be implemented.
LogDumperImpl:
The default implementation fo the LogDumper that takes care of the backgrond workog logging.
Constants:
The class has a few Constants and Enums.