Class LogFactory

java.lang.Object
com.github.rhys_h_walker.factories.LogFactory

public class LogFactory extends Object
Class that creates and stores logs in the correct location based on information supplied upon construction of the logger. This class handles the cycling of the PrintWriter object.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LogFactory(String applicationName)
    Create a LogFactory for a specific application All logs will be located under this name like this: user.home/OnRailsLogging/applicationName/ regular dated directory structure THIS METHOD WILL RETURN ON ANY ERROR
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Close any system resources correctly
    createNewLog(String message, LoggingType logType)
    Create a new log given a log type and message
    boolean
    Has this LogFactory been initialized

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LogFactory

      public LogFactory(String applicationName)
      Create a LogFactory for a specific application All logs will be located under this name like this: user.home/OnRailsLogging/applicationName/ regular dated directory structure THIS METHOD WILL RETURN ON ANY ERROR
      Parameters:
      applicationName - The name to be used
  • Method Details

    • initialized

      public boolean initialized()
      Has this LogFactory been initialized
      Returns:
      true if ok, false if not ok
    • createNewLog

      public String createNewLog(String message, LoggingType logType)
      Create a new log given a log type and message
      Parameters:
      message - The message to acompany the log
      logType - The type to be logged
      Returns:
      The timestamp String to use, format of (YYYY-MM-DD-HH:MM:SS)
    • cleanup

      public boolean cleanup()
      Close any system resources correctly
      Returns:
      true for success (Can only return true, retained functionality for future updates)