Class LogPipeline

java.lang.Object
net.orbyfied.j8.util.logging.LogPipeline

public class LogPipeline extends Object
  • Constructor Details

    • LogPipeline

      public LogPipeline()
  • Method Details

    • push

      public void push(LogRecord record)
      Pushes a logging record into the pipeline, passing it down through all handlers.
      Parameters:
      record - The record.
    • count

      public int count()
      Get the amount of handlers.
      Returns:
      The count.
    • all

      public List<LogHandler> all()
      Get a list of all handlers in order.
      Returns:
      The list.
    • get

      public LogHandler get(int i)
      Get a handler by index if inbound, or null if out of bounds.
      Parameters:
      i - The index.
      Returns:
      The handler or null.
    • get

      public LogHandler get(String name)
      Get a handler by name if present, or null if absent.
      Parameters:
      name - The name.
      Returns:
      The handler or null.
    • remove

      public LogPipeline remove(String name)
      Removes a handler by name if present, or doesn't do anything if absent.
      Parameters:
      name - The name.
      Returns:
      This.
    • remove

      public LogPipeline remove(LogHandler handler)
      Remove a handler from the pipeline.
      Parameters:
      handler - The handler.
      Returns:
      This.
    • addLast

      public LogPipeline addLast(LogHandler handler)
      Adds a handler to the pipeline, putting it in the named map if it has a name. It will search for an index if a priority is set, otherwise it will just add it to the tail of the list. It uses the approximated index as a starting point to the search for a priority. It will search for the end of the block of priority (hence addLast).
      Parameters:
      handler - The handler.
      Returns:
      This.
    • addFirst

      public LogPipeline addFirst(LogHandler handler)
      Adds a handler to the pipeline, putting it in the named map if it has a name. It will search for an index if a priority is set, otherwise it will just add it to the start of the list. It uses the approximated index as a starting point to the search for a priority. It will search for the start of the block of priority (hence addFirst).
      Parameters:
      handler - The handler.
      Returns:
      This.