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 void
changeLogVisibility
(LoggingType type, boolean active) Change whether a log type is visibile or notstatic 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 valuestatic String
Get the name of the currently running applicationstatic void
initializeLogger
(String appName, boolean consoleOnly) Initialize with an application name and default logging visibilitystatic void
initializeLogger
(String appName, HashMap<LoggingType, Boolean> logVisibility, boolean consoleOnly) Initialize the logging logicstatic String
Log a debug messagestatic String
Log an error messagestatic String
Log a info messagestatic String
logmiscellaneous
(String message) Log a miscellaneous messagestatic String
logprogress
(String message) Log a progress messagestatic String
Log a warning messagestatic void
shutdown()
Shutdown command for the logger, releases all system resources.static Boolean
viewLogVisibility
(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
-