Package com.github.rhys_h_walker
Class Logger
java.lang.Object
com.github.rhys_h_walker.Logger
The primary entrypoint for a the logger.
This file provides the methods for easy logging using different categories
- Author:
- Rhys Walker
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidchangeLogVisibility(LoggingType type, boolean active) Change whether a log type is visibile or notstatic voidchangeLogVisibilityMap(HashMap<LoggingType, Boolean> newVisibility) Set the log visibility map This map must have all 6 logging types included with none set to null valuestatic StringGet the name of the currently running applicationstatic voidinitializeLogger(String appName, boolean consoleOnly) Initialize with an application name and default logging visibilitystatic voidinitializeLogger(String appName, HashMap<LoggingType, Boolean> logVisibility, boolean consoleOnly) Initialize the logging logicstatic StringLog a debug messagestatic StringLog an error messagestatic StringLog a info messagestatic Stringlogmiscellaneous(String message) Log a miscellaneous messagestatic Stringlogprogress(String message) Log a progress messagestatic StringLog a warning messagestatic voidshutdown()Shutdown command for the logger, releases all system resources.static BooleanviewLogVisibility(LoggingType type) Is a log type currently visiblestatic HashMap<LoggingType, Boolean> Get the log visibility map
-
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 forlogVisibility- A HashMap detailing the level of loggingconsoleOnly- Boolean indicating console only logging
-
initializeLogger
Initialize with an application name and default logging visibility- Parameters:
appName- The name of the application we are logging forconsoleOnly- Boolean indicating console only logging
-
changeLogVisibility
Change whether a log type is visibile or not- Parameters:
type- the type of log to change visibility foractive- a boolean describing the whether the log is active
-
viewLogVisibility
Is a log type currently visible- Parameters:
type- Type of log to check for- Returns:
- Boolean representing visibility
-
viewVisibilityMap
Get the log visibility map- Returns:
- Log visibility map
-
changeLogVisibilityMap
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
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
Log a miscellaneous message- Parameters:
message- Message to be logged- Returns:
- the timestamp of the log
-
loginfo
Log a info message- Parameters:
message- Message to be logged- Returns:
- the timestamp of the log
-
logwarn
Log a warning message- Parameters:
message- Message to be logged- Returns:
- the timestamp of the log
-
logdebug
Log a debug message- Parameters:
message- Message to be logged- Returns:
- the timestamp of the log
-
logprogress
Log a progress message- Parameters:
message- Message to be logged- Returns:
- the timestamp of the log
-
logerror
Log an error message- Parameters:
message- Message to be logged- Returns:
- the timestamp of the log
-