Package org.jboss.logging.processor.apt

## Class ToolLogger

- java.lang.Object
- - org.jboss.logging.processor.apt.ToolLogger

    public final class ToolLogger
    extends java.lang.Object

A logger for logging messages for annotation processors.

Author:
  James R. Perkins, Kevin Pollet - SERLI - (kevin.pollet@serli.com)

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `debug​(java.lang.String messageFormat, java.lang.Object... args)` Prints a formatted debug message if debugging is enabled.
`void` `debug​(javax.lang.model.element.Element element, java.lang.String message)` Prints a debug message.
`void` `debug​(javax.lang.model.element.Element element, java.lang.String messageFormat, java.lang.Object... args)` Prints a formatted debug message if debugging is enabled.
`void` `error​(java.lang.String messageFormat, java.lang.Object... args)` Prints a formatted error message.
`void` `error​(java.lang.Throwable cause)` Prints an error message.
`void` `error​(java.lang.Throwable cause, java.lang.String messageFormat, java.lang.Object... args)` Prints an error message.
`void` `error​(java.lang.Throwable cause, javax.lang.model.element.Element element, java.lang.String message)` Prints a error message.
`void` `error​(javax.lang.model.element.Element element, java.lang.String message)` Prints a error message.
`void` `error​(javax.lang.model.element.Element element, java.lang.String messageFormat, java.lang.Object... args)` Prints a formatted error message.
`void` `error​(javax.lang.model.element.Element element, java.lang.Throwable cause)` Prints an error message.
`void` `error​(javax.lang.model.element.Element element, java.lang.Throwable cause, java.lang.String messageFormat, java.lang.Object... args)` Prints an error message.
`static ToolLogger` `getLogger​(javax.annotation.processing.ProcessingEnvironment processingEnv)` Creates a new tool logger.
`boolean` `isDebugEnabled()` Returns `true` if debugging is enabled, otherwise `false`.
`void` `mandatoryWarning​(javax.lang.model.element.Element element, java.lang.String message)` Prints a warning message.
`void` `mandatoryWarning​(javax.lang.model.element.Element element, java.lang.String messageFormat, java.lang.Object... args)` Prints a formatted warning message.
`void` `note​(javax.lang.model.element.Element element, java.lang.String message)` Prints a note message.
`void` `note​(javax.lang.model.element.Element element, java.lang.String messageFormat, java.lang.Object... args)` Prints a formatted note message.
`void` `other​(javax.lang.model.element.Element element, java.lang.String message)` Prints a message that does not fit the other types.
`void` `other​(javax.lang.model.element.Element element, java.lang.String messageFormat, java.lang.Object... args)` Prints a formatted message that does not fit the other types.
`static java.lang.String` `stackTraceToString​(java.lang.Throwable t)` Converts a stack trace to string output.
`void` `warn​(javax.lang.model.element.Element element, java.lang.String message)` Prints a warning message.
`void` `warn​(javax.lang.model.element.Element element, java.lang.String messageFormat, java.lang.Object... args)` Prints a formatted warning message.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### getLogger

    public static ToolLogger getLogger​(javax.annotation.processing.ProcessingEnvironment processingEnv)

Creates a new tool logger.

Parameters:
  `processingEnv` - the processing environment
Returns:
  a new tool logger

#### isDebugEnabled

    public boolean isDebugEnabled()

Returns `true` if debugging is enabled, otherwise `false`.

It is not necessary to invoke this method before invoking `debug` methods. The debug methods will only log messages if debugging is enabled.

Returns:
  `true` if debugging is enabled, otherwise `false`.

#### note

    public void note​(javax.lang.model.element.Element element,
                     java.lang.String message)

Prints a note message.

Parameters:
  `element` - the element to print with the note.
  `message` - the message.

#### note

    public void note​(javax.lang.model.element.Element element,
                     java.lang.String messageFormat,
                     java.lang.Object... args)

Prints a formatted note message.

Parameters:
  `element` - the element to print with the note.
  `messageFormat` - the message format.
  `args` - the format arguments.

#### debug

    public void debug​(java.lang.String messageFormat,
                      java.lang.Object... args)

Prints a formatted debug message if debugging is enabled.

Parameters:
  `messageFormat` - the message format.
  `args` - the format arguments.

#### debug

    public void debug​(javax.lang.model.element.Element element,
                      java.lang.String message)

Prints a debug message.

Parameters:
  `element` - the element to print with the note.
  `message` - the message.

#### debug

    public void debug​(javax.lang.model.element.Element element,
                      java.lang.String messageFormat,
                      java.lang.Object... args)

Prints a formatted debug message if debugging is enabled.

Parameters:
  `element` - the element to print with the note.
  `messageFormat` - the message format.
  `args` - the format arguments.

#### warn

    public void warn​(javax.lang.model.element.Element element,
                     java.lang.String message)

Prints a warning message.

Parameters:
  `element` - the element to print with the message.
  `message` - the message.

#### warn

    public void warn​(javax.lang.model.element.Element element,
                     java.lang.String messageFormat,
                     java.lang.Object... args)

Prints a formatted warning message.

Parameters:
  `element` - the element that caused the warning.
  `messageFormat` - the message format.
  `args` - the format arguments.

#### mandatoryWarning

    public void mandatoryWarning​(javax.lang.model.element.Element element,
                                 java.lang.String message)

Prints a warning message.

Parameters:
  `element` - the element to print with the message.
  `message` - the message.

#### mandatoryWarning

    public void mandatoryWarning​(javax.lang.model.element.Element element,
                                 java.lang.String messageFormat,
                                 java.lang.Object... args)

Prints a formatted warning message.

Parameters:
  `element` - the element that caused the warning.
  `messageFormat` - the message format.
  `args` - the format arguments.

#### error

    public void error​(java.lang.String messageFormat,
                      java.lang.Object... args)

Prints a formatted error message.

Parameters:
  `messageFormat` - the message format.
  `args` - the format arguments.

#### error

    public void error​(javax.lang.model.element.Element element,
                      java.lang.String message)

Prints a error message.

Parameters:
  `element` - the element to print with the message.
  `message` - the message.

#### error

    public void error​(javax.lang.model.element.Element element,
                      java.lang.String messageFormat,
                      java.lang.Object... args)

Prints a formatted error message.

Parameters:
  `messageFormat` - the message format.
  `element` - the element that caused the warning.
  `args` - the format arguments.

#### error

    public void error​(java.lang.Throwable cause)

Prints an error message.

Parameters:
  `cause` - the cause of the error.

#### error

    public void error​(java.lang.Throwable cause,
                      javax.lang.model.element.Element element,
                      java.lang.String message)

Prints a error message.

Parameters:
  `cause` - the cause of the error.
  `element` - the element to print with the message.
  `message` - the message.

#### error

    public void error​(java.lang.Throwable cause,
                      java.lang.String messageFormat,
                      java.lang.Object... args)

Prints an error message.

Parameters:
  `cause` - the cause of the error.
  `messageFormat` - the message format.
  `args` - the format arguments.

#### error

    public void error​(javax.lang.model.element.Element element,
                      java.lang.Throwable cause)

Prints an error message.

Parameters:
  `cause` - the cause of the error.
  `element` - the element that caused the error.

#### error

    public void error​(javax.lang.model.element.Element element,
                      java.lang.Throwable cause,
                      java.lang.String messageFormat,
                      java.lang.Object... args)

Prints an error message.

Parameters:
  `cause` - the cause of the error.
  `messageFormat` - the message format.
  `element` - the element that caused the warning.
  `args` - the format arguments.

#### other

    public void other​(javax.lang.model.element.Element element,
                      java.lang.String message)

Prints a message that does not fit the other types.

Parameters:
  `element` - the element to print with the message.
  `message` - the message.

#### other

    public void other​(javax.lang.model.element.Element element,
                      java.lang.String messageFormat,
                      java.lang.Object... args)

Prints a formatted message that does not fit the other types.

Parameters:
  `element` - the element to print with the note.
  `messageFormat` - the message format.
  `args` - the format arguments.

#### stackTraceToString

    public static java.lang.String stackTraceToString​(java.lang.Throwable t)

Converts a stack trace to string output.

Parameters:
  `t` - the stack trace to convert.
Returns:
  a string version of the stack trace.