상속: java.lang.Object, java.io.Serializable
예제 #1
0
 public override void publish(LogRecord logrecord)
 {
     int i = field_1000_d.getDocument().getLength();
     field_1000_d.append(field_999_a.format(logrecord));
     field_1000_d.setCaretPosition(field_1000_d.getDocument().getLength());
     int j = field_1000_d.getDocument().getLength() - i;
     if (field_998_b[field_1001_c] != 0)
     {
         field_1000_d.replaceRange("", 0, field_998_b[field_1001_c]);
     }
     field_998_b[field_1001_c] = j;
     field_1001_c = (field_1001_c + 1)%1024;
 }
예제 #2
0
        public override string format(LogRecord logrecord)
        {
            var stringbuilder = new StringBuilder();
            stringbuilder.append(dateFormat.format(Long.valueOf(logrecord.getMillis())));
            Level level = logrecord.getLevel();
            if (level == Level.FINEST)
            {
                stringbuilder.append(" [FINEST] ");
            }
            else if (level == Level.FINER)
            {
                stringbuilder.append(" [FINER] ");
            }
            else if (level == Level.FINE)
            {
                stringbuilder.append(" [FINE] ");
            }
            else if (level == Level.INFO)
            {
                stringbuilder.append(" [INFO] ");
            }
            else if (level == Level.WARNING)
            {
                stringbuilder.append(" [WARNING] ");
            }
            else if (level == Level.SEVERE)
            {
                stringbuilder.append(" [SEVERE] ");
            }
            else if (level == Level.SEVERE)
            {
                stringbuilder.append(
                    (new StringBuilder()).append(" [").append(level.getLocalizedName()).append("] ").toString());
            }
            stringbuilder.append(logrecord.getMessage());
            stringbuilder.append('\n');
            var throwable = logrecord.getThrown() as Throwable;
            if (throwable != null)
            {
                var stringwriter = new StringWriter();
                throwable.printStackTrace(new PrintWriter(stringwriter));
                stringbuilder.append(stringwriter.toString());
            }

            Debug.WriteLine(stringbuilder.toString());
            return stringbuilder.toString();
        }
예제 #3
0
 /// <summary>
 /// Format the given log record and return the formatted string.
 /// <para>
 /// The resulting formatted String will normally include a
 /// localized and formatted version of the LogRecord's message field.
 /// It is recommended to use the <seealso cref="Formatter#formatMessage"/>
 /// convenience method to localize and format the message field.
 ///
 /// </para>
 /// </summary>
 /// <param name="record"> the log record to be formatted. </param>
 /// <returns> the formatted log record </returns>
 public abstract String Format(LogRecord record);
예제 #4
0
 /// <summary>
 /// Log a LogRecord.
 /// </summary>
 public void log(LogRecord record)
 {
 }
예제 #5
0
 /// <summary>
 /// Log a LogRecord.
 /// </summary>
 public void log(LogRecord record)
 {
 }
예제 #6
0
 public virtual object call()
 {
   LogRecord.__\u003Cclinit\u003E();
   LogRecord logRecord1 = new LogRecord((Level) Level.ALL, Throwable.instancehelper_getMessage((Exception) this));
   logRecord1.setResourceBundle((ResourceBundle) new BaseChildSettings\u0024PropertyVetoExceptionThatNetBeansLikes\u00241(this));
   LogRecord[] logRecordArray = new LogRecord[1];
   int index = 0;
   LogRecord logRecord2 = logRecord1;
   logRecordArray[index] = logRecord2;
   return (object) logRecordArray;
 }
예제 #7
0
 /// <summary>
 /// Publish a <tt>LogRecord</tt>.
 /// <para>
 /// The logging request was made initially to a <tt>Logger</tt> object,
 /// which initialized the <tt>LogRecord</tt> and forwarded it here.
 /// </para>
 /// <para>
 /// </para>
 /// </summary>
 /// <param name="record">  description of the log event. A null record is
 ///                 silently ignored and is not published </param>
 public override void Publish(LogRecord record)
 {
     base.Publish(record);
     Flush();
 }