Class Logger

java.lang.Object
passwordmanager.manager.Logger

public class Logger extends Object
Logger for collecting information
Since:
2023-12-14
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static boolean
    Field indicating whether the log is enabled
    private static List<String>
    List of logs
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Hidden constructor - prevents the creation of a class object
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addLog(String prefix, String message)
    Method that creates a log entry
    static void
    Method that clears a list of log entries
    static List<String>
    Method that returns a list of log entries
    private static void
    Method initializing the Logger in accordance with the passed values
    static void
    inicialize(boolean enabledIn)
    Method initializing the Logger in accordance with the passed values

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logs

      private static List<String> logs
      List of logs
    • enabled

      private static boolean enabled
      Field indicating whether the log is enabled
  • Constructor Details

    • Logger

      private Logger()
      Hidden constructor - prevents the creation of a class object
  • Method Details

    • inicialize

      public static void inicialize(boolean enabledIn)
      Method initializing the Logger in accordance with the passed values
      Parameters:
      enabledIn - talks about the need to use logs
    • inicialize

      private static void inicialize()
      Method initializing the Logger in accordance with the passed values
    • addLog

      public static void addLog(String prefix, String message)
      Method that creates a log entry
      Parameters:
      prefix - indicates the place from which the information was transmitted
      message - stores information about the event
    • getLogs

      public static List<String> getLogs()
      Method that returns a list of log entries
      Returns:
      list of log entries
    • clear

      public static void clear()
      Method that clears a list of log entries