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:
  • Constructor Details

    • LogInterceptorStack

      public LogInterceptorStack()
  • Method Details

    • 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 interface LogInterceptor
    • 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 interface LogInterceptor
    • listForJob

      public Collection<LogInterceptor> listForJob()