diff --git a/debugger/src/main/java/org/apache/pdfbox/debugger/ui/DebugLogAppender.java b/debugger/src/main/java/org/apache/pdfbox/debugger/ui/DebugLogAppender.java index d17cf095f66..6c137cf5003 100644 --- a/debugger/src/main/java/org/apache/pdfbox/debugger/ui/DebugLogAppender.java +++ b/debugger/src/main/java/org/apache/pdfbox/debugger/ui/DebugLogAppender.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.pdfbox.debugger.ui; import org.apache.logging.log4j.*; @@ -12,31 +28,38 @@ public class DebugLogAppender extends AbstractAppender { - protected DebugLogAppender(String name, Filter filter, Layout layout, final boolean ignoreExceptions) { + protected DebugLogAppender(String name, Filter filter, Layout layout, + final boolean ignoreExceptions) + { super(name, filter, layout, ignoreExceptions); } @Override - public void append(LogEvent event) { + public void append(LogEvent event) + { // forward to your logging dialog box here. - LogDialog.instance().log(event.getLoggerName(), event.getLevel().name(), event.getMessage().getFormattedMessage(), event.getThrown()); + LogDialog.instance().log(event.getLoggerName(), event.getLevel().name(), + event.getMessage().getFormattedMessage(), event.getThrown()); } - public static void setupCustomLogger() { - ConfigurationBuilder builder = ConfigurationBuilderFactory.newConfigurationBuilder(); + public static void setupCustomLogger() + { + ConfigurationBuilder builder = ConfigurationBuilderFactory + .newConfigurationBuilder(); AppenderComponentBuilder appenderBuilder = builder.newAppender("Stdout", "CONSOLE") .addAttribute("target", ConsoleAppender.Target.SYSTEM_OUT); - appenderBuilder.add(builder.newLayout("PatternLayout") - .addAttribute("pattern", "%d [%t] %-5level: %msg%n%throwable")); + appenderBuilder.add(builder.newLayout("PatternLayout").addAttribute("pattern", + "%d [%t] %-5level: %msg%n%throwable")); builder.add(appenderBuilder); appenderBuilder = builder.newAppender("Custom", "org.package.CustomAppender"); - appenderBuilder.add(builder.newLayout("PatternLayout") - .addAttribute("pattern", "%d [%t] %-5level: %msg%n%throwable")); + appenderBuilder.add(builder.newLayout("PatternLayout").addAttribute("pattern", + "%d [%t] %-5level: %msg%n%throwable")); builder.add(appenderBuilder); - builder.add(builder.newRootLogger(Level.ERROR).add(builder.newAppenderRef("Stdout")).add(builder.newAppenderRef("Custom"))); + builder.add(builder.newRootLogger(Level.ERROR).add(builder.newAppenderRef("Stdout")) + .add(builder.newAppenderRef("Custom"))); Configurator.initialize(builder.build()); } -} \ No newline at end of file +}