Class TAIL

java.lang.Object
org.jpos.q2.cli.TAIL
All Implemented Interfaces:
EventListener, CLICommand, LogListener

public class TAIL extends Object implements CLICommand, LogListener
CLI command that subscribes to one or more named loggers and streams their events to the terminal until the user presses Enter.
  • Constructor Details

    • TAIL

      public TAIL()
      Default constructor; no instance state to initialise.
  • Method Details

    • exec

      public void exec(CLIContext cli, String[] args) throws Exception
      Description copied from interface: CLICommand
      Executes the CLI command.
      Specified by:
      exec in interface CLICommand
      Parameters:
      cli - the CLI context
      args - command arguments
      Throws:
      Exception - on error
    • usage

      public void usage(CLIContext cli)
      Prints command usage and lists the registered loggers.
      Parameters:
      cli - the CLI context to write to
    • log

      public LogEvent log(LogEvent ev)
      Description copied from interface: LogListener
      Processes a log event.
      Specified by:
      log in interface LogListener
      Parameters:
      ev - the log event
      Returns:
      the (potentially modified) log event, or null to suppress it