Class TransformerDebugLog
java.lang.Object
org.alfresco.util.LogAdapter
org.alfresco.repo.content.transform.TransformerDebugLog
- All Implemented Interfaces:
org.apache.commons.logging.Log
Implementation of a
Log that logs messages to a structure accessible via TransformerConfigMBean.getTransformationDebugLog(int).
- Author:
- Alan Davis
-
Field Summary
Fields inherited from class org.alfresco.util.LogAdapter
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddOrModify(Deque<org.alfresco.repo.content.transform.DebugEntry> entries, Object message) Overridden in sub classes to add a new entry or modify and existing onevoidString[]getEntries(int n) Returns the log entries.protected StringOverridden to specify the property name that specifies the maximum number of entries.protected intOverridden to specify the maximum value the maxEntries property may set.booleanEnabled if number of transformer debug entries is greater than 0 AND there is not a test function generating output.protected voidRemoves an entry.voidsetProperties(Properties properties) voidsetTransformerDebug(TransformerDebug transformerDebug) Methods inherited from class org.alfresco.util.LogAdapter
debug, error, error, fatal, fatal, info, info, isErrorEnabled, isFatalEnabled, isInfoEnabled, isTraceEnabled, isWarnEnabled, trace, trace, warn, warnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.logging.Log
debug, error, error, fatal, fatal, info, info, isErrorEnabled, isFatalEnabled, isInfoEnabled, isTraceEnabled, isWarnEnabled, trace, trace, warn, warn
-
Constructor Details
-
TransformerDebugLog
public TransformerDebugLog()
-
-
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 20 as this is debug and we must currently walk the whole structure each time an new request id is added.
-
getPropertyName
Overridden to specify the property name that specifies the maximum number of entries. -
addOrModify
protected void addOrModify(Deque<org.alfresco.repo.content.transform.DebugEntry> entries, Object message) Overridden in sub classes to add a new entry or modify and existing one -
setTransformerDebug
-
setProperties
-
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:
isDebugEnabledin interfaceorg.apache.commons.logging.Log- Overrides:
isDebugEnabledin classLogAdapter
-
debug
- Specified by:
debugin interfaceorg.apache.commons.logging.Log- Overrides:
debugin classLogAdapter- Parameters:
message- to be appended to the logthrowable- ignored
-
remove
Removes an entry. By default removes the first (oldest) entry by may be overridden. -
getEntries
Returns the log entries.- Parameters:
n- the maximum number of entries to return. All if n is smaller or equal to zero.
-