Class CompilerLogger

java.lang.Object
org.openjdk.asmtools.common.ToolLogger
org.openjdk.asmtools.common.CompilerLogger
All Implemented Interfaces:
ILogger

public class CompilerLogger extends ToolLogger implements ILogger
  • Field Details

  • Constructor Details

    • CompilerLogger

      public CompilerLogger(String programName, Class<?> cls, DualStreamToolOutput outerLog)
      Parameters:
      programName - the tool name
      cls - the environment class of the tool for which to obtain the resource bundle
      outerLog - the logger stream
  • Method Details

    • warning

      public void warning(int where, String id, Object... args)
      Specified by:
      warning in interface ILogger
    • error

      public void error(int where, String id, Object... args)
      Specified by:
      error in interface ILogger
    • getInfo

      public String getInfo(String id, Object... args)
      Specified by:
      getInfo in interface ILogger
    • usage

      public void usage(List<String> usageIDs)
      Specified by:
      usage in class ToolLogger
    • setInputFileName

      public void setInputFileName(ToolInput inputFileName) throws IOException
      Overrides:
      setInputFileName in class ToolLogger
      Throws:
      IOException
    • filePosition

      Pair<Integer,Integer> filePosition(int where)
      Gets a pair of line number and line position for the pointer where A position consists of: ((linenr >> OFFSETBITS) | offset) this means that both the line number and the exact offset into the file are encoded in each position value.
      Parameters:
      where - absolute position in file = (linepos << OFFSETBITS) | bytepos;
      Returns:
      the pair: [line number, line offset]
    • lineNumber

      public int lineNumber(int where)
    • getCount

      public long getCount(EMessageKind kind)
    • noMessages

      public boolean noMessages()
    • flush

      public int flush(boolean printTotals)
      Parameters:
      printTotals - whether to print the total line: N warning(s), K error(s)
      Returns:
      0 if there are no errors otherwise a number of errors
    • printAffectedSourceLine

      private void printAffectedSourceLine(ToolOutput output, Pair<Integer,Integer> filePosition)
    • insert

      private void insert(int where, ToolLogger.Message message)
      Insert a message in the list of outstanding messages. The list is sorted on input position.
    • addToContainer

      private void addToContainer(int where, ToolLogger.Message msg)