java.lang.Object
net.i2p.jetty.I2PLogger
All Implemented Interfaces:
Logger

public class I2PLoggerextends Object implements Logger
Modified from Jetty 6.1.26 StdErrLog.java and Slf4jLog.java Usage: org.eclipse.log.Log.setLog(new I2PLogger(ctx));
  • Field Details

    • _log

      private final Log _log
      The I2P logger messages go to.
    • _buffer

      private final StringBuilder _buffer
      Builds the formatted message.
  • Constructor Details

    • I2PLogger

      public I2PLogger()
      Construct a logger against the global application context.
    • I2PLogger

      public I2PLogger(I2PAppContext ctx)
      Construct a logger against a specific application context.
      Parameters:
      ctx - the I2P application context
  • Method Details

    • isDebugEnabled

      public boolean isDebugEnabled()
      Specified by:
      isDebugEnabled in interface Logger
    • setDebugEnabled

      public void setDebugEnabled(boolean enabled)
      Specified by:
      setDebugEnabled in interface Logger
    • info

      public void info(String msg, Object arg0, Object arg1)
      Throwable when it is the only non-null argument together with the formatted line
      Parameters:
      msg - the message to log @param arg0 first arg @param arg1 second arg
      arg0 - substituted for the first {} placeholder in msg, or logged as the
      arg1 - substituted for the second {} placeholder, or logged as the throwable
    • debug

      public void debug(String msg, Throwable th)
      Log a debug message with a throwable.
      Specified by:
      debug in interface Logger
      Parameters:
      msg - the message to log @param th the throwable
    • debug

      public void debug(String msg, Object arg0, Object arg1)
      Throwable when it is the only non-null argument together with the formatted line
      Parameters:
      msg - the message to log @param arg0 first arg @param arg1 second arg
      arg0 - substituted for the first {} placeholder in msg, or logged as the
      arg1 - substituted for the second {} placeholder, or logged as the throwable
    • warn

      public void warn(String msg, Object arg0, Object arg1)
      Throwable when it is the only non-null argument together with the formatted line
      Parameters:
      msg - the message to log @param arg0 first arg @param arg1 second arg
      arg0 - substituted for the first {} placeholder in msg, or logged as the
      arg1 - substituted for the second {} placeholder, or logged as the throwable
    • warn

      public void warn(String msg, Throwable th)
      Specified by:
      warn in interface Logger
    • format

      private void format(String msg, Object arg0, Object arg1)
      Writes one message with two arguments.
      Parameters:
      msg - the message to log with placeholders
      arg0 - the first argument
      arg1 - the second argument
    • format

      private void format(String msg)
      Writes one message with no arguments.
      Parameters:
      msg - the message to log
    • getLogger

      public Logger getLogger(String name)
      Specified by:
      getLogger in interface Logger
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • ignore

      public void ignore(Throwable ignored)
      No-op, required by the Jetty logger interface.
      Specified by:
      ignore in interface Logger
    • debug

      public void debug(Throwable thrown)
      Log a throwable at debug level.
      Specified by:
      debug in interface Logger
    • debug

      public void debug(String msg, Object... args)
      Log a formatted debug message.
      Specified by:
      debug in interface Logger
    • info

      public void info(Throwable thrown)
      Log a throwable at info level.
      Specified by:
      info in interface Logger
    • info

      public void info(String msg, Object... args)
      Log a formatted info message.
      Specified by:
      info in interface Logger
    • info

      public void info(String msg, Throwable th)
      Log an info message with a throwable.
      Specified by:
      info in interface Logger
    • warn

      public void warn(Throwable thrown)
      Log a throwable at warn level.
      Specified by:
      warn in interface Logger
    • warn

      public void warn(String msg, Object... args)
      Log a formatted warn message.
      Specified by:
      warn in interface Logger
    • getName

      public String getName()
      Return the logger's name, as Jetty reports it.
      Specified by:
      getName in interface Logger
      Returns:
      the logger's class name, "net.i2p.jetty.I2PLogger"
    • debug

      public void debug(String msg, long arg)
      Log a debug message with one argument.
      Specified by:
      debug in interface Logger