Class LogInterceptorStack
- java.lang.Object
-
- com.atlassian.bamboo.build.logger.LogInterceptorStack
-
- All Implemented Interfaces:
LogInterceptor
,Serializable
public class LogInterceptorStack extends Object implements LogInterceptor
This class handles attaching/detaching of interceptors and the actual interception forwarding. It contains stack for job and task level. Task level interceptors are cleaned after task completion, but job level interceptors are never cleaned up.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LogInterceptorStack()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(@NotNull LogInterceptor interceptor)
Adds a new task interceptor to stackvoid
addForJob(@NotNull LogInterceptor interceptor)
Adds a new job interceptor to stackvoid
clear()
Removes all task interceptors from stack.void
clearFromJob()
Removes all job interceptors.void
intercept(@NotNull LogEntry logEntry)
Method invoked whenever a new log entry is loggedvoid
interceptError(@NotNull LogEntry logEntry)
Method invoked whenever a new error log entry is loggedCollection<LogInterceptor>
listForJob()
void
remove(@Nullable LogInterceptor interceptor)
Removes a task interceptor from stackvoid
removeFromJob(@Nullable LogInterceptor interceptor)
Removes a job interceptor from stack
-
-
-
Method Detail
-
clear
public void clear()
Removes all task interceptors from stack.
-
clearFromJob
public void clearFromJob()
Removes all job interceptors.
-
add
public void add(@NotNull @NotNull LogInterceptor interceptor)
Adds a new task interceptor to stack- Parameters:
interceptor
- the interceptor to add
-
addForJob
public void addForJob(@NotNull @NotNull LogInterceptor interceptor)
Adds a new job interceptor to stack- Parameters:
interceptor
- the interceptor to add
-
remove
public void remove(@Nullable @Nullable LogInterceptor interceptor)
Removes a task interceptor from stack- Parameters:
interceptor
- the interceptor to remove
-
removeFromJob
public void removeFromJob(@Nullable @Nullable LogInterceptor interceptor)
Removes a job interceptor from stack- Parameters:
interceptor
- the interceptor to remove
-
intercept
public void intercept(@NotNull @NotNull LogEntry logEntry)
Description copied from interface:LogInterceptor
Method invoked whenever a new log entry is logged- Specified by:
intercept
in interfaceLogInterceptor
-
interceptError
public void interceptError(@NotNull @NotNull LogEntry logEntry)
Description copied from interface:LogInterceptor
Method invoked whenever a new error log entry is logged- Specified by:
interceptError
in interfaceLogInterceptor
-
listForJob
public Collection<LogInterceptor> listForJob()
-
-