Class Logger

java.lang.Object
com.github.rhys_h_walker.Logger

public class Logger extends Object
The primary entrypoint for a the logger. This file provides the methods for easy logging using different categories
Author:
Rhys Walker
  • Method Details

    • initializeLogger

      public static void initializeLogger(String appName, HashMap<LoggingType,Boolean> logVisibility, boolean consoleOnly)
      Initialize the logging logic
      Parameters:
      appName - The name of the application we are logging for
      logVisibility - A HashMap detailing the level of logging
      consoleOnly - Boolean indicating console only logging
    • initializeLogger

      public static void initializeLogger(String appName, boolean consoleOnly)
      Initialize with an application name and default logging visibility
      Parameters:
      appName - The name of the application we are logging for
      consoleOnly - Boolean indicating console only logging
    • changeLogVisibility

      public static void changeLogVisibility(LoggingType type, boolean active)
      Change whether a log type is visibile or not
      Parameters:
      type - the type of log to change visibility for
      active - a boolean describing the whether the log is active
    • viewLogVisibility

      public static Boolean viewLogVisibility(LoggingType type)
      Is a log type currently visible
      Parameters:
      type - Type of log to check for
      Returns:
      Boolean representing visibility
    • viewVisibilityMap

      public static HashMap<LoggingType,Boolean> viewVisibilityMap()
      Get the log visibility map
      Returns:
      Log visibility map
    • changeLogVisibilityMap

      public static void changeLogVisibilityMap(HashMap<LoggingType,Boolean> newVisibility)
      Set the log visibility map This map must have all 6 logging types included with none set to null value
      Parameters:
      newVisibility - The new hashmap to set
    • getApplicationName

      public static String getApplicationName()
      Get the name of the currently running application
      Returns:
      Currently running application name
    • shutdown

      public static void shutdown()
      Shutdown command for the logger, releases all system resources.
    • logmiscellaneous

      public static String logmiscellaneous(String message)
      Log a miscellaneous message
      Parameters:
      message - Message to be logged
      Returns:
      the timestamp of the log
    • loginfo

      public static String loginfo(String message)
      Log a info message
      Parameters:
      message - Message to be logged
      Returns:
      the timestamp of the log
    • logwarn

      public static String logwarn(String message)
      Log a warning message
      Parameters:
      message - Message to be logged
      Returns:
      the timestamp of the log
    • logdebug

      public static String logdebug(String message)
      Log a debug message
      Parameters:
      message - Message to be logged
      Returns:
      the timestamp of the log
    • logprogress

      public static String logprogress(String message)
      Log a progress message
      Parameters:
      message - Message to be logged
      Returns:
      the timestamp of the log
    • logerror

      public static String logerror(String message)
      Log an error message
      Parameters:
      message - Message to be logged
      Returns:
      the timestamp of the log