Class TransformerLog

java.lang.Object
org.alfresco.util.LogAdapter
org.alfresco.repo.content.transform.TransformerLog
All Implemented Interfaces:
org.apache.commons.logging.Log

@AlfrescoPublicApi public class TransformerLog extends LogAdapter
Implementation of a Log that logs messages to a structure accessible via TransformerConfigMBean.getTransformationLog(int).

Author:
Alan Davis
  • Constructor Details

    • TransformerLog

      public TransformerLog()
  • Method Details

    • getUpperMaxEntries

      protected int getUpperMaxEntries()
      Overridden to specify the maximum value the maxEntries property may set. Generally quite a small number as values are stored in memory.

      Returns 100 as this is currently held in memory.

    • getPropertyName

      protected String getPropertyName()
      Overridden to specify the property name that specifies the maximum number of entries.
    • addOrModify

      protected void addOrModify(Deque<String> entries, Object message)
      Overridden in sub classes to add a new entry or modify and existing one
    • setTransformerDebug

      public void setTransformerDebug(TransformerDebug transformerDebug)
    • setProperties

      public void setProperties(Properties properties)
    • isDebugEnabled

      public boolean isDebugEnabled()
      Enabled if number of transformer debug entries is greater than 0 AND there is not a test function generating output.
      Specified by:
      isDebugEnabled in interface org.apache.commons.logging.Log
      Overrides:
      isDebugEnabled in class LogAdapter
    • debug

      public void debug(Object message, Throwable throwable)
      Specified by:
      debug in interface org.apache.commons.logging.Log
      Overrides:
      debug in class LogAdapter
      Parameters:
      message - to be appended to the log
      throwable - ignored
    • remove

      protected void remove(Deque<String> entries)
      Removes an entry. By default removes the first (oldest) entry by may be overridden.
    • getEntries

      public String[] getEntries(int n)
      Returns the log entries.
      Parameters:
      n - the maximum number of entries to return. All if n is smaller or equal to zero.