Package java.util.logging

Examples of java.util.logging.Formatter.format()


            for (int i = 0; i < lineCount; i++) {
                final int ix = (reversed) ?
                    Math.abs((theStart-i)%this.buffer.length) :
                    (theStart+i)%this.buffer.length;
                record = this.buffer[ix];
                logMessages.append(logFormatter.format(record));
            }
            return logMessages.toString();
        } catch (final Exception ex) {
            // We don't want to throw an exception here, but we
            // report the exception to any registered ErrorManager.
View Full Code Here


            for (int i = 0; i < lineCount; i++) {
                final int ix = (reversed) ?
                    Math.abs((theStart-i)%this.buffer.length) :
                    (theStart + i) % this.buffer.length;
                record = this.buffer[ix];
                logMessages.add(logFormatter.format(record));
            }
            return logMessages.toArray(new String[logMessages.size()]);
        } catch (final Exception ex) {
            // We don't want to throw an exception here, but we
            // report the exception to any registered ErrorManager.
View Full Code Here

    try {
      String value;

      Formatter formatter = getFormatter();
      if (formatter != null)
        value = formatter.format(record);
      else
        value = record.getMessage();

      _conn.message(_to, value);
    } catch (RuntimeException e) {
View Full Code Here

    try {
      String value;

      Formatter formatter = getFormatter();
      if (formatter != null)
        value = formatter.format(record);
      else
        value = record.getMessage();

      for (BlockingQueue queue : _queueList) {
        queue.offer(value);
View Full Code Here

    try {
      String value;

      Formatter formatter = getFormatter();
      if (formatter != null)
        value = formatter.format(record);
      else {
        value = record.getMessage();

        Throwable thrown = record.getThrown();
        if (thrown != null) {
View Full Code Here

            if (record.getMessage() == null) {
                record.setMessage("");
            }

            Formatter formatter = getFormatter();
            String msg = formatter.format(record);

            addRow(record.getLevel(), msg);
        }

        @Override
View Full Code Here

        handler.publicSetOutputStream(out);
        handler.publish(r);
        handler.close();
        String msg = new String(out.toByteArray());
        Formatter f = handler.getFormatter();
        assertEquals(msg, f.getHead(handler) + f.format(r) + f.getTail(handler));
        assertFileContent(HOMEPATH, "setoutput.log", handler.getFormatter(), null);
    }

    /*
     * Class under test for void FileHandler(String)
View Full Code Here

    * override this method.
    */
   protected void subPublish(LogRecord record)
   {
      Formatter fmt = getFormatter();
      String msg = fmt.format(record);
      synchronized (this)
      {
         try
         {
            msgWriter.write(msg);
View Full Code Here

    * @param record
    */
   protected void subPublish(LogRecord record)
   {
      Formatter fmt = getFormatter();
      String msg = fmt.format(record);
      synchronized (this)
      {
         try
         {
            msgWriter.write(msg);
View Full Code Here

    * override this method.
    */
   protected void subPublish(LogRecord record)
   {
      Formatter fmt = getFormatter();
      String msg = fmt.format(record);
      synchronized (this)
      {
         try
         {
            msgWriter.write(msg);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.