java.lang.Object
org.matwoess.jsourceprofiler.tool.instrument.Logger

public class Logger extends Object
This class is used to log the parsing process.

It is used to print the current entering or exiting of a program component to the console. It also provides methods to log special events (e.g., finding a control flow break).

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    boolean
    Whether the logger should print log messages.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new Logger for the given parser.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    log(String logMessage)
    Prints the given log message to the console.
    void
    log(String formatString, Object... values)
    Prints the given log message to the console.

    Methods inherited from class java.lang.Object

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

    • active

      public boolean active
      Whether the logger should print log messages.
  • Constructor Details

    • Logger

      public Logger(Parser p)
      Creates a new Logger for the given parser.
      Parameters:
      p - the parser object to log for
  • Method Details

    • log

      public void log(String logMessage)
      Prints the given log message to the console.

      Only prints the message if the logger is active.

      Parameters:
      logMessage - the log message to print
    • log

      public void log(String formatString, Object... values)
      Prints the given log message to the console.

      Only prints the message if the logger is active.

      Parameters:
      formatString - the format string of the log message to print
      values - the values to insert into the format string