X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Flog%2FJLoggerLog4j.java;h=22f3a55379cc005eed0e7163ecdd5cd0970dae95;hb=49ff0aa506eb0b2e031fa3e8d16337e0c8cf2508;hp=ca24e30072a4f5ada2f358889b4fbf9ffa6877c4;hpb=a1984b1c8c273ed33c7ce9283039f4027dcae2de;p=jalview.git diff --git a/src/jalview/log/JLoggerLog4j.java b/src/jalview/log/JLoggerLog4j.java index ca24e30..22f3a55 100644 --- a/src/jalview/log/JLoggerLog4j.java +++ b/src/jalview/log/JLoggerLog4j.java @@ -1,3 +1,23 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.log; import org.apache.logging.log4j.Logger; @@ -10,6 +30,16 @@ public class JLoggerLog4j extends JLogger implements JLoggerI { private Logger logger = null; + public static JLoggerLog4j getLogger(Class c) + { + return getLogger(c); + } + + public static JLoggerLog4j getLogger(Class c, LogLevel loglevel) + { + return getLogger(c.getCanonicalName(), loglevel); + } + public static JLoggerLog4j getLogger(String name) { return getLogger(name, LogLevel.INFO); @@ -23,7 +53,6 @@ public class JLoggerLog4j extends JLogger implements JLoggerI private JLoggerLog4j(String name, LogLevel level) { - // super(name, level); this.name = name; this.level = level; this.loggerSetup(); @@ -120,11 +149,11 @@ public class JLoggerLog4j extends JLogger implements JLoggerI return this.logger; } - public synchronized static void addAppender(JLoggerLog4j l1, + public synchronized static void addAppender(JLoggerLog4j level, Appender appender) { if (!Platform.isJS()) - Log4j.addAppender(l1.getLoggerObject(), appender); + Log4j.addAppender(level.getLoggerObject(), appender); } public synchronized static void addAppender(JLoggerLog4j l1,