pax_global_header00006660000000000000000000000064141673751450014527gustar00rootroot0000000000000052 comment=96f73e44d677aa82e27d8b5433641e0a9dffd902 jboss-logging-3.4.3.Final/000077500000000000000000000000001416737514500153325ustar00rootroot00000000000000jboss-logging-3.4.3.Final/.github/000077500000000000000000000000001416737514500166725ustar00rootroot00000000000000jboss-logging-3.4.3.Final/.github/workflows/000077500000000000000000000000001416737514500207275ustar00rootroot00000000000000jboss-logging-3.4.3.Final/.github/workflows/ci.yml000066400000000000000000000020511416737514500220430ustar00rootroot00000000000000# This workflow will build a Java project with Maven # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven name: JBoss Logging - CI on: push: branches: - '**' pull_request: types: [opened, synchronize, reopened, ready_for_review] jobs: build: name: ${{ matrix.os }}-jdk${{ matrix.java }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest ] java: ['8', '11', '17'] steps: - uses: actions/checkout@v2 - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v2 with: distribution: 'temurin' java-version: ${{ matrix.java }} cache: 'maven' - name: Build and Test on Java ${{ matrix.java }} run: mvn clean install - uses: actions/upload-artifact@v2 if: failure() with: name: surefire-reports-${{ matrix.os }}-${{ matrix.java }} path: '**/surefire-reports/*.txt'jboss-logging-3.4.3.Final/.gitignore000066400000000000000000000000371416737514500173220ustar00rootroot00000000000000*.iml *.ipr *.iws target .idea jboss-logging-3.4.3.Final/pom.xml000066400000000000000000000356721416737514500166640ustar00rootroot00000000000000 4.0.0 org.jboss.logging jboss-logging 3.4.3.Final jar JBoss Logging 3 http://www.jboss.org The JBoss Logging Framework scm:git:git://github.com/jboss-logging/jboss-logging.git https://github.com/jboss-logging/jboss-logging org.jboss jboss-parent 39 Apache License, version 2.0 http://www.apache.org/licenses/LICENSE-2.0.txt repo 1.2.8 1.2.17 2.17.1 2.1.18.Final 5.8.2 1.7.32 5.1.3 true ${project.build.directory}${file.separator}cp-test-classes org.junit junit-bom ${version.org.junit} pom import org.jboss.logmanager jboss-logmanager ${version.org.jboss.logmanager} provided log4j log4j ${version.org.apache.log4j} provided com.sun.jdmk jmxtools com.sun.jmx jmxri org.apache.logging.log4j log4j-api ${version.org.apache.logging.log4j} provided org.slf4j slf4j-api ${version.org.sfl4j} provided org.junit.jupiter junit-jupiter test ch.qos.logback logback-classic ${version.ch.qos.logback} test org.apache.logging.log4j log4j-core ${version.org.apache.logging.log4j} test maven-compiler-plugin default-test-compile testCompile test-compile **/*ClassPathTestCase.java cp-test-compile testCompile test-compile ${cp.test.classes.dir} ${skip.cp.tests} **/*ClassPathTestCase.java maven-source-plugin maven-surefire-plugin ${maven.test.redirectTestOutputToFile} false true default test false **/*ClassPathTestCase.java org.jboss.logmanager.LogManager jboss-logmanager-cp-test test false ${cp.test.classes.dir} **/JBossLogManagerClassPathTestCase.java org.apache.logging.log4j log4j org.slf4j ch.qos.logback org.jboss.logmanager.LogManager log4j2-cp-test test test false ${cp.test.classes.dir} **/Log4j2ClassPathTestCase.java org.jboss.logmanager log4j org.slf4j ch.qos.logback log4j-cp-test test test false ${cp.test.classes.dir} **/Log4jClassPathTestCase.java org.apache.logging.log4j org.jboss.logmanager org.slf4j ch.qos.logback slf4j-cp-test test test false ${cp.test.classes.dir} **/Slf4jClassPathTestCase.java org.apache.logging.log4j org.jboss.logmanager log4j jul-cp-test test false ${cp.test.classes.dir} **/JulClassPathTestCase.java org.apache.logging.log4j org.jboss.logmanager log4j org.slf4j ch.qos.logback maven-jar-plugin ${project.build.outputDirectory}/META-INF/MANIFEST.MF org.apache.felix maven-bundle-plugin true false org.jboss.logging ${project.groupId}.*;version=${project.version};-split-package:=error org.apache.log4j.config;resolution:=optional, *;resolution:=optional bundle-manifest process-classes manifest jboss-logging-3.4.3.Final/src/000077500000000000000000000000001416737514500161215ustar00rootroot00000000000000jboss-logging-3.4.3.Final/src/main/000077500000000000000000000000001416737514500170455ustar00rootroot00000000000000jboss-logging-3.4.3.Final/src/main/java/000077500000000000000000000000001416737514500177665ustar00rootroot00000000000000jboss-logging-3.4.3.Final/src/main/java/org/000077500000000000000000000000001416737514500205555ustar00rootroot00000000000000jboss-logging-3.4.3.Final/src/main/java/org/jboss/000077500000000000000000000000001416737514500216755ustar00rootroot00000000000000jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/000077500000000000000000000000001416737514500233235ustar00rootroot00000000000000jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/AbstractLoggerProvider.java000066400000000000000000000046341416737514500306130ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.util.ArrayDeque; abstract class AbstractLoggerProvider { private final ThreadLocal> ndcStack = new ThreadLocal>(); public void clearNdc() { ArrayDeque stack = ndcStack.get(); if (stack != null) stack.clear(); } public String getNdc() { ArrayDeque stack = ndcStack.get(); return stack == null || stack.isEmpty() ? null : stack.peek().merged; } public int getNdcDepth() { ArrayDeque stack = ndcStack.get(); return stack == null ? 0 : stack.size(); } public String peekNdc() { ArrayDeque stack = ndcStack.get(); return stack == null || stack.isEmpty() ? "" : stack.peek().current; } public String popNdc() { ArrayDeque stack = ndcStack.get(); return stack == null || stack.isEmpty() ? "" : stack.pop().current; } public void pushNdc(String message) { ArrayDeque stack = ndcStack.get(); if (stack == null) { stack = new ArrayDeque(); ndcStack.set(stack); } stack.push(stack.isEmpty() ? new Entry(message) : new Entry(stack.peek(), message)); } public void setNdcMaxDepth(int maxDepth) { final ArrayDeque stack = ndcStack.get(); if (stack != null) while (stack.size() > maxDepth) stack.pop(); } private static class Entry { private String merged; private String current; Entry(String current) { merged = current; this.current = current; } Entry(Entry parent, String current) { merged = parent.merged + ' ' + current; this.current = current; } } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/AbstractMdcLoggerProvider.java000066400000000000000000000034101416737514500312260ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.util.Collections; import java.util.HashMap; import java.util.Map; abstract class AbstractMdcLoggerProvider extends AbstractLoggerProvider { private final ThreadLocal> mdcMap = new ThreadLocal>(); public void clearMdc() { final Map map = mdcMap.get(); if (map != null) { map.clear(); } } public Object getMdc(String key) { return mdcMap.get() == null ? null : mdcMap.get().get(key); } public Map getMdcMap() { final Map map = mdcMap.get(); return map == null ? Collections.emptyMap() : map; } public Object putMdc(String key, Object value) { Map map = mdcMap.get(); if (map == null) { map = new HashMap(); mdcMap.set(map); } return map.put(key, value); } public void removeMdc(String key) { Map map = mdcMap.get(); if (map == null) return; map.remove(key); } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/BasicLogger.java000066400000000000000000002033631416737514500263560ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed 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.jboss.logging; /** * An interface which specifies the basic logger methods. When used as the base interface of a typed logger, these methods will delegate * to the corresponding underlying logger instance. * * @author David M. Lloyd */ public interface BasicLogger { /** * Check to see if the given level is enabled for this logger. * * @param level the level to check for * @return {@code true} if messages may be logged at the given level, {@code false} otherwise */ boolean isEnabled(Logger.Level level); /** * Check to see if the {@code TRACE} level is enabled for this logger. * * @return {@code true} if messages logged at {@link org.jboss.logging.Logger.Level#TRACE} may be accepted, {@code false} otherwise */ boolean isTraceEnabled(); /** * Issue a log message with a level of TRACE. * * @param message the message */ void trace(Object message); /** * Issue a log message and throwable with a level of TRACE. * * @param message the message * @param t the throwable */ void trace(Object message, Throwable t); /** * Issue a log message and throwable with a level of TRACE and a specific logger class name. * * @param loggerFqcn the logger class name * @param message the message * @param t the throwable */ void trace(String loggerFqcn, Object message, Throwable t); /** * Issue a log message with parameters and a throwable with a level of TRACE. * * @param loggerFqcn the logger class name * @param message the message * @param params the message parameters * @param t the throwable */ void trace(String loggerFqcn, Object message, Object[] params, Throwable t); /** * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param params the parameters */ void tracev(String format, Object... params); /** * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the sole parameter */ void tracev(String format, Object param1); /** * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ void tracev(String format, Object param1, Object param2); /** * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void tracev(String format, Object param1, Object param2, Object param3); /** * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param params the parameters */ void tracev(Throwable t, String format, Object... params); /** * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the sole parameter */ void tracev(Throwable t, String format, Object param1); /** * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ void tracev(Throwable t, String format, Object param1, Object param2); /** * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void tracev(Throwable t, String format, Object param1, Object param2, Object param3); /** * Issue a formatted log message with a level of TRACE. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param params the parameters */ void tracef(String format, Object... params); /** * Issue a formatted log message with a level of TRACE. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the sole parameter */ void tracef(String format, Object param1); /** * Issue a formatted log message with a level of TRACE. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter */ void tracef(String format, Object param1, Object param2); /** * Issue a formatted log message with a level of TRACE. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void tracef(String format, Object param1, Object param2, Object param3); /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param params the parameters */ void tracef(Throwable t, String format, Object... params); /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the sole parameter */ void tracef(Throwable t, String format, Object param1); /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter */ void tracef(Throwable t, String format, Object param1, Object param2); /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void tracef(Throwable t, String format, Object param1, Object param2, Object param3); /** * Issue a formatted log message with a level of TRACE. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg the parameter */ void tracef(String format, int arg); /** * Issue a formatted log message with a level of TRACE. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter */ void tracef(String format, int arg1, int arg2); /** * Issue a formatted log message with a level of TRACE. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter */ void tracef(String format, int arg1, Object arg2); /** * Issue a formatted log message with a level of TRACE. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void tracef(String format, int arg1, int arg2, int arg3); /** * Issue a formatted log message with a level of TRACE. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void tracef(String format, int arg1, int arg2, Object arg3); /** * Issue a formatted log message with a level of TRACE. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void tracef(String format, int arg1, Object arg2, Object arg3); /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg the parameter */ void tracef(Throwable t, String format, int arg); /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter */ void tracef(Throwable t, String format, int arg1, int arg2); /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter */ void tracef(Throwable t, String format, int arg1, Object arg2); /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void tracef(Throwable t, String format, int arg1, int arg2, int arg3); /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void tracef(Throwable t, String format, int arg1, int arg2, Object arg3); /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void tracef(Throwable t, String format, int arg1, Object arg2, Object arg3); /** * Issue a formatted log message with a level of TRACE. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg the parameter */ void tracef(String format, long arg); /** * Issue a formatted log message with a level of TRACE. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter */ void tracef(String format, long arg1, long arg2); /** * Issue a formatted log message with a level of TRACE. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter */ void tracef(String format, long arg1, Object arg2); /** * Issue a formatted log message with a level of TRACE. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void tracef(String format, long arg1, long arg2, long arg3); /** * Issue a formatted log message with a level of TRACE. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void tracef(String format, long arg1, long arg2, Object arg3); /** * Issue a formatted log message with a level of TRACE. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void tracef(String format, long arg1, Object arg2, Object arg3); /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg the parameter */ void tracef(Throwable t, String format, long arg); /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter */ void tracef(Throwable t, String format, long arg1, long arg2); /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter */ void tracef(Throwable t, String format, long arg1, Object arg2); /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void tracef(Throwable t, String format, long arg1, long arg2, long arg3); /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void tracef(Throwable t, String format, long arg1, long arg2, Object arg3); /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void tracef(Throwable t, String format, long arg1, Object arg2, Object arg3); /** * Check to see if the {@code DEBUG} level is enabled for this logger. * * @return {@code true} if messages logged at {@link org.jboss.logging.Logger.Level#DEBUG} may be accepted, {@code false} otherwise */ boolean isDebugEnabled(); /** * Issue a log message with a level of DEBUG. * * @param message the message */ void debug(Object message); /** * Issue a log message and throwable with a level of DEBUG. * * @param message the message * @param t the throwable */ void debug(Object message, Throwable t); /** * Issue a log message and throwable with a level of DEBUG and a specific logger class name. * * @param loggerFqcn the logger class name * @param message the message * @param t the throwable */ void debug(String loggerFqcn, Object message, Throwable t); /** * Issue a log message with parameters and a throwable with a level of DEBUG. * * @param loggerFqcn the logger class name * @param message the message * @param params the message parameters * @param t the throwable */ void debug(String loggerFqcn, Object message, Object[] params, Throwable t); /** * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param params the parameters */ void debugv(String format, Object... params); /** * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the sole parameter */ void debugv(String format, Object param1); /** * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ void debugv(String format, Object param1, Object param2); /** * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void debugv(String format, Object param1, Object param2, Object param3); /** * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param params the parameters */ void debugv(Throwable t, String format, Object... params); /** * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the sole parameter */ void debugv(Throwable t, String format, Object param1); /** * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ void debugv(Throwable t, String format, Object param1, Object param2); /** * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void debugv(Throwable t, String format, Object param1, Object param2, Object param3); /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param params the parameters */ void debugf(String format, Object... params); /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the sole parameter */ void debugf(String format, Object param1); /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter */ void debugf(String format, Object param1, Object param2); /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void debugf(String format, Object param1, Object param2, Object param3); /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param params the parameters */ void debugf(Throwable t, String format, Object... params); /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the sole parameter */ void debugf(Throwable t, String format, Object param1); /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter */ void debugf(Throwable t, String format, Object param1, Object param2); /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void debugf(Throwable t, String format, Object param1, Object param2, Object param3); /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg the parameter */ void debugf(String format, int arg); /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter */ void debugf(String format, int arg1, int arg2); /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter */ void debugf(String format, int arg1, Object arg2); /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void debugf(String format, int arg1, int arg2, int arg3); /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void debugf(String format, int arg1, int arg2, Object arg3); /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void debugf(String format, int arg1, Object arg2, Object arg3); /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg the parameter */ void debugf(Throwable t, String format, int arg); /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter */ void debugf(Throwable t, String format, int arg1, int arg2); /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter */ void debugf(Throwable t, String format, int arg1, Object arg2); /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void debugf(Throwable t, String format, int arg1, int arg2, int arg3); /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void debugf(Throwable t, String format, int arg1, int arg2, Object arg3); /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void debugf(Throwable t, String format, int arg1, Object arg2, Object arg3); /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg the parameter */ void debugf(String format, long arg); /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter */ void debugf(String format, long arg1, long arg2); /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter */ void debugf(String format, long arg1, Object arg2); /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void debugf(String format, long arg1, long arg2, long arg3); /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void debugf(String format, long arg1, long arg2, Object arg3); /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void debugf(String format, long arg1, Object arg2, Object arg3); /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg the parameter */ void debugf(Throwable t, String format, long arg); /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter */ void debugf(Throwable t, String format, long arg1, long arg2); /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter */ void debugf(Throwable t, String format, long arg1, Object arg2); /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void debugf(Throwable t, String format, long arg1, long arg2, long arg3); /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void debugf(Throwable t, String format, long arg1, long arg2, Object arg3); /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param arg1 the first parameter * @param arg2 the second parameter * @param arg3 the third parameter */ void debugf(Throwable t, String format, long arg1, Object arg2, Object arg3); /** * Check to see if the {@code INFO} level is enabled for this logger. * * @return {@code true} if messages logged at {@link org.jboss.logging.Logger.Level#INFO} may be accepted, {@code false} otherwise */ boolean isInfoEnabled(); /** * Issue a log message with a level of INFO. * * @param message the message */ void info(Object message); /** * Issue a log message and throwable with a level of INFO. * * @param message the message * @param t the throwable */ void info(Object message, Throwable t); /** * Issue a log message and throwable with a level of INFO and a specific logger class name. * * @param loggerFqcn the logger class name * @param message the message * @param t the throwable */ void info(String loggerFqcn, Object message, Throwable t); /** * Issue a log message with parameters and a throwable with a level of INFO. * * @param loggerFqcn the logger class name * @param message the message * @param params the message parameters * @param t the throwable */ void info(String loggerFqcn, Object message, Object[] params, Throwable t); /** * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param params the parameters */ void infov(String format, Object... params); /** * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the sole parameter */ void infov(String format, Object param1); /** * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ void infov(String format, Object param1, Object param2); /** * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void infov(String format, Object param1, Object param2, Object param3); /** * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param params the parameters */ void infov(Throwable t, String format, Object... params); /** * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the sole parameter */ void infov(Throwable t, String format, Object param1); /** * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ void infov(Throwable t, String format, Object param1, Object param2); /** * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void infov(Throwable t, String format, Object param1, Object param2, Object param3); /** * Issue a formatted log message with a level of INFO. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param params the parameters */ void infof(String format, Object... params); /** * Issue a formatted log message with a level of INFO. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the sole parameter */ void infof(String format, Object param1); /** * Issue a formatted log message with a level of INFO. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter */ void infof(String format, Object param1, Object param2); /** * Issue a formatted log message with a level of INFO. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void infof(String format, Object param1, Object param2, Object param3); /** * Issue a formatted log message with a level of INFO. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param params the parameters */ void infof(Throwable t, String format, Object... params); /** * Issue a formatted log message with a level of INFO. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the sole parameter */ void infof(Throwable t, String format, Object param1); /** * Issue a formatted log message with a level of INFO. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter */ void infof(Throwable t, String format, Object param1, Object param2); /** * Issue a formatted log message with a level of INFO. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void infof(Throwable t, String format, Object param1, Object param2, Object param3); /** * Issue a log message with a level of WARN. * * @param message the message */ void warn(Object message); /** * Issue a log message and throwable with a level of WARN. * * @param message the message * @param t the throwable */ void warn(Object message, Throwable t); /** * Issue a log message and throwable with a level of WARN and a specific logger class name. * * @param loggerFqcn the logger class name * @param message the message * @param t the throwable */ void warn(String loggerFqcn, Object message, Throwable t); /** * Issue a log message with parameters and a throwable with a level of WARN. * * @param loggerFqcn the logger class name * @param message the message * @param params the message parameters * @param t the throwable */ void warn(String loggerFqcn, Object message, Object[] params, Throwable t); /** * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param params the parameters */ void warnv(String format, Object... params); /** * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the sole parameter */ void warnv(String format, Object param1); /** * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ void warnv(String format, Object param1, Object param2); /** * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void warnv(String format, Object param1, Object param2, Object param3); /** * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param params the parameters */ void warnv(Throwable t, String format, Object... params); /** * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the sole parameter */ void warnv(Throwable t, String format, Object param1); /** * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ void warnv(Throwable t, String format, Object param1, Object param2); /** * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void warnv(Throwable t, String format, Object param1, Object param2, Object param3); /** * Issue a formatted log message with a level of WARN. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param params the parameters */ void warnf(String format, Object... params); /** * Issue a formatted log message with a level of WARN. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the sole parameter */ void warnf(String format, Object param1); /** * Issue a formatted log message with a level of WARN. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter */ void warnf(String format, Object param1, Object param2); /** * Issue a formatted log message with a level of WARN. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void warnf(String format, Object param1, Object param2, Object param3); /** * Issue a formatted log message with a level of WARN. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param params the parameters */ void warnf(Throwable t, String format, Object... params); /** * Issue a formatted log message with a level of WARN. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the sole parameter */ void warnf(Throwable t, String format, Object param1); /** * Issue a formatted log message with a level of WARN. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter */ void warnf(Throwable t, String format, Object param1, Object param2); /** * Issue a formatted log message with a level of WARN. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void warnf(Throwable t, String format, Object param1, Object param2, Object param3); /** * Issue a log message with a level of ERROR. * * @param message the message */ void error(Object message); /** * Issue a log message and throwable with a level of ERROR. * * @param message the message * @param t the throwable */ void error(Object message, Throwable t); /** * Issue a log message and throwable with a level of ERROR and a specific logger class name. * * @param loggerFqcn the logger class name * @param message the message * @param t the throwable */ void error(String loggerFqcn, Object message, Throwable t); /** * Issue a log message with parameters and a throwable with a level of ERROR. * * @param loggerFqcn the logger class name * @param message the message * @param params the message parameters * @param t the throwable */ void error(String loggerFqcn, Object message, Object[] params, Throwable t); /** * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param params the parameters */ void errorv(String format, Object... params); /** * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the sole parameter */ void errorv(String format, Object param1); /** * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ void errorv(String format, Object param1, Object param2); /** * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void errorv(String format, Object param1, Object param2, Object param3); /** * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param params the parameters */ void errorv(Throwable t, String format, Object... params); /** * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the sole parameter */ void errorv(Throwable t, String format, Object param1); /** * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ void errorv(Throwable t, String format, Object param1, Object param2); /** * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void errorv(Throwable t, String format, Object param1, Object param2, Object param3); /** * Issue a formatted log message with a level of ERROR. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param params the parameters */ void errorf(String format, Object... params); /** * Issue a formatted log message with a level of ERROR. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the sole parameter */ void errorf(String format, Object param1); /** * Issue a formatted log message with a level of ERROR. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter */ void errorf(String format, Object param1, Object param2); /** * Issue a formatted log message with a level of ERROR. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void errorf(String format, Object param1, Object param2, Object param3); /** * Issue a formatted log message with a level of ERROR. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param params the parameters */ void errorf(Throwable t, String format, Object... params); /** * Issue a formatted log message with a level of ERROR. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the sole parameter */ void errorf(Throwable t, String format, Object param1); /** * Issue a formatted log message with a level of ERROR. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter */ void errorf(Throwable t, String format, Object param1, Object param2); /** * Issue a formatted log message with a level of ERROR. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void errorf(Throwable t, String format, Object param1, Object param2, Object param3); /** * Issue a log message with a level of FATAL. * * @param message the message */ void fatal(Object message); /** * Issue a log message and throwable with a level of FATAL. * * @param message the message * @param t the throwable */ void fatal(Object message, Throwable t); /** * Issue a log message and throwable with a level of FATAL and a specific logger class name. * * @param loggerFqcn the logger class name * @param message the message * @param t the throwable */ void fatal(String loggerFqcn, Object message, Throwable t); /** * Issue a log message with parameters and a throwable with a level of FATAL. * * @param loggerFqcn the logger class name * @param message the message * @param params the message parameters * @param t the throwable */ void fatal(String loggerFqcn, Object message, Object[] params, Throwable t); /** * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param params the parameters */ void fatalv(String format, Object... params); /** * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the sole parameter */ void fatalv(String format, Object param1); /** * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ void fatalv(String format, Object param1, Object param2); /** * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void fatalv(String format, Object param1, Object param2, Object param3); /** * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param params the parameters */ void fatalv(Throwable t, String format, Object... params); /** * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the sole parameter */ void fatalv(Throwable t, String format, Object param1); /** * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ void fatalv(Throwable t, String format, Object param1, Object param2); /** * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void fatalv(Throwable t, String format, Object param1, Object param2, Object param3); /** * Issue a formatted log message with a level of FATAL. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param params the parameters */ void fatalf(String format, Object... params); /** * Issue a formatted log message with a level of FATAL. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the sole parameter */ void fatalf(String format, Object param1); /** * Issue a formatted log message with a level of FATAL. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter */ void fatalf(String format, Object param1, Object param2); /** * Issue a formatted log message with a level of FATAL. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void fatalf(String format, Object param1, Object param2, Object param3); /** * Issue a formatted log message with a level of FATAL. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param params the parameters */ void fatalf(Throwable t, String format, Object... params); /** * Issue a formatted log message with a level of FATAL. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the sole parameter */ void fatalf(Throwable t, String format, Object param1); /** * Issue a formatted log message with a level of FATAL. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter */ void fatalf(Throwable t, String format, Object param1, Object param2); /** * Issue a formatted log message with a level of FATAL. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void fatalf(Throwable t, String format, Object param1, Object param2, Object param3); /** * Log a message at the given level. * * @param level the level * @param message the message */ void log(Logger.Level level, Object message); /** * Issue a log message and throwable at the given log level. * * @param level the level * @param message the message * @param t the throwable */ void log(Logger.Level level, Object message, Throwable t); /** * Issue a log message and throwable at the given log level and a specific logger class name. * * @param level the level * @param loggerFqcn the logger class name * @param message the message * @param t the throwable */ void log(Logger.Level level, String loggerFqcn, Object message, Throwable t); /** * Issue a log message with parameters and a throwable at the given log level. * * @param loggerFqcn the logger class name * @param level the level * @param message the message * @param params the message parameters * @param t the throwable */ void log(String loggerFqcn, Logger.Level level, Object message, Object[] params, Throwable t); /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param level the level * @param format the message format string * @param params the parameters */ void logv(Logger.Level level, String format, Object... params); /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param level the level * @param format the message format string * @param param1 the sole parameter */ void logv(Logger.Level level, String format, Object param1); /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param level the level * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ void logv(Logger.Level level, String format, Object param1, Object param2); /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param level the level * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void logv(Logger.Level level, String format, Object param1, Object param2, Object param3); /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param level the level * @param t the throwable * @param format the message format string * @param params the parameters */ void logv(Logger.Level level, Throwable t, String format, Object... params); /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param level the level * @param t the throwable * @param format the message format string * @param param1 the sole parameter */ void logv(Logger.Level level, Throwable t, String format, Object param1); /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param level the level * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ void logv(Logger.Level level, Throwable t, String format, Object param1, Object param2); /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param level the level * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void logv(Logger.Level level, Throwable t, String format, Object param1, Object param2, Object param3); /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param loggerFqcn the logger class name * @param level the level * @param t the throwable * @param format the message format string * @param params the parameters */ void logv(String loggerFqcn, Logger.Level level, Throwable t, String format, Object... params); /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param loggerFqcn the logger class name * @param level the level * @param t the throwable * @param format the message format string * @param param1 the sole parameter */ void logv(String loggerFqcn, Logger.Level level, Throwable t, String format, Object param1); /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param loggerFqcn the logger class name * @param level the level * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ void logv(String loggerFqcn, Logger.Level level, Throwable t, String format, Object param1, Object param2); /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param loggerFqcn the logger class name * @param level the level * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void logv(String loggerFqcn, Logger.Level level, Throwable t, String format, Object param1, Object param2, Object param3); /** * Issue a formatted log message at the given log level. * * @param level the level * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param params the parameters */ void logf(Logger.Level level, String format, Object... params); /** * Issue a formatted log message at the given log level. * * @param level the level * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the sole parameter */ void logf(Logger.Level level, String format, Object param1); /** * Issue a formatted log message at the given log level. * * @param level the level * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter */ void logf(Logger.Level level, String format, Object param1, Object param2); /** * Issue a formatted log message at the given log level. * * @param level the level * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void logf(Logger.Level level, String format, Object param1, Object param2, Object param3); /** * Issue a formatted log message at the given log level. * * @param level the level * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param params the parameters */ void logf(Logger.Level level, Throwable t, String format, Object... params); /** * Issue a formatted log message at the given log level. * * @param level the level * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the sole parameter */ void logf(Logger.Level level, Throwable t, String format, Object param1); /** * Issue a formatted log message at the given log level. * * @param level the level * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter */ void logf(Logger.Level level, Throwable t, String format, Object param1, Object param2); /** * Issue a formatted log message at the given log level. * * @param level the level * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void logf(Logger.Level level, Throwable t, String format, Object param1, Object param2, Object param3); /** * Log a message at the given level. * * @param loggerFqcn the logger class name * @param level the level * @param t the throwable cause * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the sole parameter */ void logf(String loggerFqcn, Logger.Level level, Throwable t, String format, Object param1); /** * Log a message at the given level. * * @param loggerFqcn the logger class name * @param level the level * @param t the throwable cause * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter */ void logf(String loggerFqcn, Logger.Level level, Throwable t, String format, Object param1, Object param2); /** * Log a message at the given level. * * @param loggerFqcn the logger class name * @param level the level * @param t the throwable cause * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ void logf(String loggerFqcn, Logger.Level level, Throwable t, String format, Object param1, Object param2, Object param3); /** * Log a message at the given level. * * @param loggerFqcn the logger class name * @param level the level * @param t the throwable cause * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param params the message parameters */ void logf(String loggerFqcn, Logger.Level level, Throwable t, String format, Object... params); } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/DelegatingBasicLogger.java000066400000000000000000001066761416737514500303530ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2011 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed 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.jboss.logging; import java.io.Serializable; /** * A serializable, delegating basic logger instance. * * @author David M. Lloyd */ public class DelegatingBasicLogger implements BasicLogger, Serializable { private static final long serialVersionUID = -5774903162389601853L; /** * The cached logger class name. */ private static final String FQCN = DelegatingBasicLogger.class.getName(); /** * The delegate logger. */ protected final Logger log; /** * Construct a new instance. * * @param log the logger to which calls should be delegated */ public DelegatingBasicLogger(final Logger log) { this.log = log; } @Override public boolean isTraceEnabled() { return log.isTraceEnabled(); } @Override public void trace(final Object message) { log.trace(FQCN, message, null); } @Override public void trace(final Object message, final Throwable t) { log.trace(FQCN, message, t); } @Override public void trace(final String loggerFqcn, final Object message, final Throwable t) { log.trace(loggerFqcn, message, t); } @Override public void trace(final String loggerFqcn, final Object message, final Object[] params, final Throwable t) { log.trace(loggerFqcn, message, params, t); } @Override public void tracev(final String format, final Object... params) { log.logv(FQCN, Logger.Level.TRACE, null, format, params); } @Override public void tracev(final String format, final Object param1) { log.logv(FQCN, Logger.Level.TRACE, null, format, param1); } @Override public void tracev(final String format, final Object param1, final Object param2) { log.logv(FQCN, Logger.Level.TRACE, null, format, param1, param2); } @Override public void tracev(final String format, final Object param1, final Object param2, final Object param3) { log.logv(FQCN, Logger.Level.TRACE, null, format, param1, param2, param3); } @Override public void tracev(final Throwable t, final String format, final Object... params) { log.logv(FQCN, Logger.Level.TRACE, t, format, params); } @Override public void tracev(final Throwable t, final String format, final Object param1) { log.logv(FQCN, Logger.Level.TRACE, t, format, param1); } @Override public void tracev(final Throwable t, final String format, final Object param1, final Object param2) { log.logv(FQCN, Logger.Level.TRACE, t, format, param1, param2); } @Override public void tracev(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { log.logv(FQCN, Logger.Level.TRACE, t, format, param1, param2, param3); } @Override public void tracef(final String format, final Object... params) { log.logf(FQCN, Logger.Level.TRACE, null, format, params); } @Override public void tracef(final String format, final Object param1) { log.logf(FQCN, Logger.Level.TRACE, null, format, param1); } @Override public void tracef(final String format, final Object param1, final Object param2) { log.logf(FQCN, Logger.Level.TRACE, null, format, param1, param2); } @Override public void tracef(final String format, final Object param1, final Object param2, final Object param3) { log.logf(FQCN, Logger.Level.TRACE, null, format, param1, param2, param3); } @Override public void tracef(final Throwable t, final String format, final Object... params) { log.logf(FQCN, Logger.Level.TRACE, t, format, params); } @Override public void tracef(final Throwable t, final String format, final Object param1) { log.logf(FQCN, Logger.Level.TRACE, t, format, param1); } @Override public void tracef(final Throwable t, final String format, final Object param1, final Object param2) { log.logf(FQCN, Logger.Level.TRACE, t, format, param1, param2); } @Override public void tracef(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { log.logf(FQCN, Logger.Level.TRACE, t, format, param1, param2, param3); } @Override public void tracef(final String format, final int arg) { log.tracef(format, arg); } @Override public void tracef(final String format, final int arg1, final int arg2) { log.tracef(format, arg1, arg2); } @Override public void tracef(final String format, final int arg1, final Object arg2) { log.tracef(format, arg1, arg2); } @Override public void tracef(final String format, final int arg1, final int arg2, final int arg3) { log.tracef(format, arg1, arg2, arg3); } @Override public void tracef(final String format, final int arg1, final int arg2, final Object arg3) { log.tracef(format, arg1, arg2, arg3); } @Override public void tracef(final String format, final int arg1, final Object arg2, final Object arg3) { log.tracef(format, arg1, arg2, arg3); } @Override public void tracef(final Throwable t, final String format, final int arg) { log.tracef(t, format, arg); } @Override public void tracef(final Throwable t, final String format, final int arg1, final int arg2) { log.tracef(t, format, arg1, arg2); } @Override public void tracef(final Throwable t, final String format, final int arg1, final Object arg2) { log.tracef(t, format, arg1, arg2); } @Override public void tracef(final Throwable t, final String format, final int arg1, final int arg2, final int arg3) { log.tracef(t, format, arg1, arg2, arg3); } @Override public void tracef(final Throwable t, final String format, final int arg1, final int arg2, final Object arg3) { log.tracef(t, format, arg1, arg2, arg3); } @Override public void tracef(final Throwable t, final String format, final int arg1, final Object arg2, final Object arg3) { log.tracef(t, format, arg1, arg2, arg3); } @Override public void tracef(final String format, final long arg) { log.tracef(format, arg); } @Override public void tracef(final String format, final long arg1, final long arg2) { log.tracef(format, arg1, arg2); } @Override public void tracef(final String format, final long arg1, final Object arg2) { log.tracef(format, arg1, arg2); } @Override public void tracef(final String format, final long arg1, final long arg2, final long arg3) { log.tracef(format, arg1, arg2, arg3); } @Override public void tracef(final String format, final long arg1, final long arg2, final Object arg3) { log.tracef(format, arg1, arg2, arg3); } @Override public void tracef(final String format, final long arg1, final Object arg2, final Object arg3) { log.tracef(format, arg1, arg2, arg3); } @Override public void tracef(final Throwable t, final String format, final long arg) { log.tracef(t, format, arg); } @Override public void tracef(final Throwable t, final String format, final long arg1, final long arg2) { log.tracef(t, format, arg1, arg2); } @Override public void tracef(final Throwable t, final String format, final long arg1, final Object arg2) { log.tracef(t, format, arg1, arg2); } @Override public void tracef(final Throwable t, final String format, final long arg1, final long arg2, final long arg3) { log.tracef(t, format, arg1, arg2, arg3); } @Override public void tracef(final Throwable t, final String format, final long arg1, final long arg2, final Object arg3) { log.tracef(t, format, arg1, arg2, arg3); } @Override public void tracef(final Throwable t, final String format, final long arg1, final Object arg2, final Object arg3) { log.tracef(t, format, arg1, arg2, arg3); } @Override public boolean isDebugEnabled() { return log.isDebugEnabled(); } @Override public void debug(final Object message) { log.debug(FQCN, message, null); } @Override public void debug(final Object message, final Throwable t) { log.debug(FQCN, message, t); } @Override public void debug(final String loggerFqcn, final Object message, final Throwable t) { log.debug(loggerFqcn, message, t); } @Override public void debug(final String loggerFqcn, final Object message, final Object[] params, final Throwable t) { log.debug(loggerFqcn, message, params, t); } @Override public void debugv(final String format, final Object... params) { log.logv(FQCN, Logger.Level.DEBUG, null, format, params); } @Override public void debugv(final String format, final Object param1) { log.logv(FQCN, Logger.Level.DEBUG, null, format, param1); } @Override public void debugv(final String format, final Object param1, final Object param2) { log.logv(FQCN, Logger.Level.DEBUG, null, format, param1, param2); } @Override public void debugv(final String format, final Object param1, final Object param2, final Object param3) { log.logv(FQCN, Logger.Level.DEBUG, null, format, param1, param2, param3); } @Override public void debugv(final Throwable t, final String format, final Object... params) { log.logv(FQCN, Logger.Level.DEBUG, t, format, params); } @Override public void debugv(final Throwable t, final String format, final Object param1) { log.logv(FQCN, Logger.Level.DEBUG, t, format, param1); } @Override public void debugv(final Throwable t, final String format, final Object param1, final Object param2) { log.logv(FQCN, Logger.Level.DEBUG, t, format, param1, param2); } @Override public void debugv(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { log.logv(FQCN, Logger.Level.DEBUG, t, format, param1, param2, param3); } @Override public void debugf(final String format, final Object... params) { log.logf(FQCN, Logger.Level.DEBUG, null, format, params); } @Override public void debugf(final String format, final Object param1) { log.logf(FQCN, Logger.Level.DEBUG, null, format, param1); } @Override public void debugf(final String format, final Object param1, final Object param2) { log.logf(FQCN, Logger.Level.DEBUG, null, format, param1, param2); } @Override public void debugf(final String format, final Object param1, final Object param2, final Object param3) { log.logf(FQCN, Logger.Level.DEBUG, null, format, param1, param2, param3); } @Override public void debugf(final Throwable t, final String format, final Object... params) { log.logf(FQCN, Logger.Level.DEBUG, t, format, params); } @Override public void debugf(final Throwable t, final String format, final Object param1) { log.logf(FQCN, Logger.Level.DEBUG, t, format, param1); } @Override public void debugf(final Throwable t, final String format, final Object param1, final Object param2) { log.logf(FQCN, Logger.Level.DEBUG, t, format, param1, param2); } @Override public void debugf(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { log.logf(FQCN, Logger.Level.DEBUG, t, format, param1, param2, param3); } @Override public void debugf(final String format, final int arg) { log.debugf(format, arg); } @Override public void debugf(final String format, final int arg1, final int arg2) { log.debugf(format, arg1, arg2); } @Override public void debugf(final String format, final int arg1, final Object arg2) { log.debugf(format, arg1, arg2); } @Override public void debugf(final String format, final int arg1, final int arg2, final int arg3) { log.debugf(format, arg1, arg2, arg3); } @Override public void debugf(final String format, final int arg1, final int arg2, final Object arg3) { log.debugf(format, arg1, arg2, arg3); } @Override public void debugf(final String format, final int arg1, final Object arg2, final Object arg3) { log.debugf(format, arg1, arg2, arg3); } @Override public void debugf(final Throwable t, final String format, final int arg) { log.debugf(t, format, arg); } @Override public void debugf(final Throwable t, final String format, final int arg1, final int arg2) { log.debugf(t, format, arg1, arg2); } @Override public void debugf(final Throwable t, final String format, final int arg1, final Object arg2) { log.debugf(t, format, arg1, arg2); } @Override public void debugf(final Throwable t, final String format, final int arg1, final int arg2, final int arg3) { log.debugf(t, format, arg1, arg2, arg3); } @Override public void debugf(final Throwable t, final String format, final int arg1, final int arg2, final Object arg3) { log.debugf(t, format, arg1, arg2, arg3); } @Override public void debugf(final Throwable t, final String format, final int arg1, final Object arg2, final Object arg3) { log.debugf(t, format, arg1, arg2, arg3); } @Override public void debugf(final String format, final long arg) { log.debugf(format, arg); } @Override public void debugf(final String format, final long arg1, final long arg2) { log.debugf(format, arg1, arg2); } @Override public void debugf(final String format, final long arg1, final Object arg2) { log.debugf(format, arg1, arg2); } @Override public void debugf(final String format, final long arg1, final long arg2, final long arg3) { log.debugf(format, arg1, arg2, arg3); } @Override public void debugf(final String format, final long arg1, final long arg2, final Object arg3) { log.debugf(format, arg1, arg2, arg3); } @Override public void debugf(final String format, final long arg1, final Object arg2, final Object arg3) { log.debugf(format, arg1, arg2, arg3); } @Override public void debugf(final Throwable t, final String format, final long arg) { log.debugf(t, format, arg); } @Override public void debugf(final Throwable t, final String format, final long arg1, final long arg2) { log.debugf(t, format, arg1, arg2); } @Override public void debugf(final Throwable t, final String format, final long arg1, final Object arg2) { log.debugf(t, format, arg1, arg2); } @Override public void debugf(final Throwable t, final String format, final long arg1, final long arg2, final long arg3) { log.debugf(t, format, arg1, arg2, arg3); } @Override public void debugf(final Throwable t, final String format, final long arg1, final long arg2, final Object arg3) { log.debugf(t, format, arg1, arg2, arg3); } @Override public void debugf(final Throwable t, final String format, final long arg1, final Object arg2, final Object arg3) { log.debugf(t, format, arg1, arg2, arg3); } @Override public boolean isInfoEnabled() { return log.isInfoEnabled(); } @Override public void info(final Object message) { log.info(FQCN, message, null); } @Override public void info(final Object message, final Throwable t) { log.info(FQCN, message, t); } @Override public void info(final String loggerFqcn, final Object message, final Throwable t) { log.info(loggerFqcn, message, t); } @Override public void info(final String loggerFqcn, final Object message, final Object[] params, final Throwable t) { log.info(loggerFqcn, message, params, t); } @Override public void infov(final String format, final Object... params) { log.logv(FQCN, Logger.Level.INFO, null, format, params); } @Override public void infov(final String format, final Object param1) { log.logv(FQCN, Logger.Level.INFO, null, format, param1); } @Override public void infov(final String format, final Object param1, final Object param2) { log.logv(FQCN, Logger.Level.INFO, null, format, param1, param2); } @Override public void infov(final String format, final Object param1, final Object param2, final Object param3) { log.logv(FQCN, Logger.Level.INFO, null, format, param1, param2, param3); } @Override public void infov(final Throwable t, final String format, final Object... params) { log.logv(FQCN, Logger.Level.INFO, t, format, params); } @Override public void infov(final Throwable t, final String format, final Object param1) { log.logv(FQCN, Logger.Level.INFO, t, format, param1); } @Override public void infov(final Throwable t, final String format, final Object param1, final Object param2) { log.logv(FQCN, Logger.Level.INFO, t, format, param1, param2); } @Override public void infov(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { log.logv(FQCN, Logger.Level.INFO, t, format, param1, param2, param3); } @Override public void infof(final String format, final Object... params) { log.logf(FQCN, Logger.Level.INFO, null, format, params); } @Override public void infof(final String format, final Object param1) { log.logf(FQCN, Logger.Level.INFO, null, format, param1); } @Override public void infof(final String format, final Object param1, final Object param2) { log.logf(FQCN, Logger.Level.INFO, null, format, param1, param2); } @Override public void infof(final String format, final Object param1, final Object param2, final Object param3) { log.logf(FQCN, Logger.Level.INFO, null, format, param1, param2, param3); } @Override public void infof(final Throwable t, final String format, final Object... params) { log.logf(FQCN, Logger.Level.INFO, t, format, params); } @Override public void infof(final Throwable t, final String format, final Object param1) { log.logf(FQCN, Logger.Level.INFO, t, format, param1); } @Override public void infof(final Throwable t, final String format, final Object param1, final Object param2) { log.logf(FQCN, Logger.Level.INFO, t, format, param1, param2); } @Override public void infof(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { log.logf(FQCN, Logger.Level.INFO, t, format, param1, param2, param3); } @Override public void warn(final Object message) { log.warn(FQCN, message, null); } @Override public void warn(final Object message, final Throwable t) { log.warn(FQCN, message, t); } @Override public void warn(final String loggerFqcn, final Object message, final Throwable t) { log.warn(loggerFqcn, message, t); } @Override public void warn(final String loggerFqcn, final Object message, final Object[] params, final Throwable t) { log.warn(loggerFqcn, message, params, t); } @Override public void warnv(final String format, final Object... params) { log.logv(FQCN, Logger.Level.WARN, null, format, params); } @Override public void warnv(final String format, final Object param1) { log.logv(FQCN, Logger.Level.WARN, null, format, param1); } @Override public void warnv(final String format, final Object param1, final Object param2) { log.logv(FQCN, Logger.Level.WARN, null, format, param1, param2); } @Override public void warnv(final String format, final Object param1, final Object param2, final Object param3) { log.logv(FQCN, Logger.Level.WARN, null, format, param1, param2, param3); } @Override public void warnv(final Throwable t, final String format, final Object... params) { log.logv(FQCN, Logger.Level.WARN, t, format, params); } @Override public void warnv(final Throwable t, final String format, final Object param1) { log.logv(FQCN, Logger.Level.WARN, t, format, param1); } @Override public void warnv(final Throwable t, final String format, final Object param1, final Object param2) { log.logv(FQCN, Logger.Level.WARN, t, format, param1, param2); } @Override public void warnv(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { log.logv(FQCN, Logger.Level.WARN, t, format, param1, param2, param3); } @Override public void warnf(final String format, final Object... params) { log.logf(FQCN, Logger.Level.WARN, null, format, params); } @Override public void warnf(final String format, final Object param1) { log.logf(FQCN, Logger.Level.WARN, null, format, param1); } @Override public void warnf(final String format, final Object param1, final Object param2) { log.logf(FQCN, Logger.Level.WARN, null, format, param1, param2); } @Override public void warnf(final String format, final Object param1, final Object param2, final Object param3) { log.logf(FQCN, Logger.Level.WARN, null, format, param1, param2, param3); } @Override public void warnf(final Throwable t, final String format, final Object... params) { log.logf(FQCN, Logger.Level.WARN, t, format, params); } @Override public void warnf(final Throwable t, final String format, final Object param1) { log.logf(FQCN, Logger.Level.WARN, t, format, param1); } @Override public void warnf(final Throwable t, final String format, final Object param1, final Object param2) { log.logf(FQCN, Logger.Level.WARN, t, format, param1, param2); } @Override public void warnf(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { log.logf(FQCN, Logger.Level.WARN, t, format, param1, param2, param3); } @Override public void error(final Object message) { log.error(FQCN, message, null); } @Override public void error(final Object message, final Throwable t) { log.error(FQCN, message, t); } @Override public void error(final String loggerFqcn, final Object message, final Throwable t) { log.error(loggerFqcn, message, t); } @Override public void error(final String loggerFqcn, final Object message, final Object[] params, final Throwable t) { log.error(loggerFqcn, message, params, t); } @Override public void errorv(final String format, final Object... params) { log.logv(FQCN, Logger.Level.ERROR, null, format, params); } @Override public void errorv(final String format, final Object param1) { log.logv(FQCN, Logger.Level.ERROR, null, format, param1); } @Override public void errorv(final String format, final Object param1, final Object param2) { log.logv(FQCN, Logger.Level.ERROR, null, format, param1, param2); } @Override public void errorv(final String format, final Object param1, final Object param2, final Object param3) { log.logv(FQCN, Logger.Level.ERROR, null, format, param1, param2, param3); } @Override public void errorv(final Throwable t, final String format, final Object... params) { log.logv(FQCN, Logger.Level.ERROR, t, format, params); } @Override public void errorv(final Throwable t, final String format, final Object param1) { log.logv(FQCN, Logger.Level.ERROR, t, format, param1); } @Override public void errorv(final Throwable t, final String format, final Object param1, final Object param2) { log.logv(FQCN, Logger.Level.ERROR, t, format, param1, param2); } @Override public void errorv(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { log.logv(FQCN, Logger.Level.ERROR, t, format, param1, param2, param3); } @Override public void errorf(final String format, final Object... params) { log.logf(FQCN, Logger.Level.ERROR, null, format, params); } @Override public void errorf(final String format, final Object param1) { log.logf(FQCN, Logger.Level.ERROR, null, format, param1); } @Override public void errorf(final String format, final Object param1, final Object param2) { log.logf(FQCN, Logger.Level.ERROR, null, format, param1, param2); } @Override public void errorf(final String format, final Object param1, final Object param2, final Object param3) { log.logf(FQCN, Logger.Level.ERROR, null, format, param1, param2, param3); } @Override public void errorf(final Throwable t, final String format, final Object... params) { log.logf(FQCN, Logger.Level.ERROR, t, format, params); } @Override public void errorf(final Throwable t, final String format, final Object param1) { log.logf(FQCN, Logger.Level.ERROR, t, format, param1); } @Override public void errorf(final Throwable t, final String format, final Object param1, final Object param2) { log.logf(FQCN, Logger.Level.ERROR, t, format, param1, param2); } @Override public void errorf(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { log.logf(FQCN, Logger.Level.ERROR, t, format, param1, param2, param3); } @Override public void fatal(final Object message) { log.fatal(FQCN, message, null); } @Override public void fatal(final Object message, final Throwable t) { log.fatal(FQCN, message, t); } @Override public void fatal(final String loggerFqcn, final Object message, final Throwable t) { log.fatal(loggerFqcn, message, t); } @Override public void fatal(final String loggerFqcn, final Object message, final Object[] params, final Throwable t) { log.fatal(loggerFqcn, message, params, t); } @Override public void fatalv(final String format, final Object... params) { log.logv(FQCN, Logger.Level.FATAL, null, format, params); } @Override public void fatalv(final String format, final Object param1) { log.logv(FQCN, Logger.Level.FATAL, null, format, param1); } @Override public void fatalv(final String format, final Object param1, final Object param2) { log.logv(FQCN, Logger.Level.FATAL, null, format, param1, param2); } @Override public void fatalv(final String format, final Object param1, final Object param2, final Object param3) { log.logv(FQCN, Logger.Level.FATAL, null, format, param1, param2, param3); } @Override public void fatalv(final Throwable t, final String format, final Object... params) { log.logv(FQCN, Logger.Level.FATAL, t, format, params); } @Override public void fatalv(final Throwable t, final String format, final Object param1) { log.logv(FQCN, Logger.Level.FATAL, t, format, param1); } @Override public void fatalv(final Throwable t, final String format, final Object param1, final Object param2) { log.logv(FQCN, Logger.Level.FATAL, t, format, param1, param2); } @Override public void fatalv(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { log.logv(FQCN, Logger.Level.FATAL, t, format, param1, param2, param3); } @Override public void fatalf(final String format, final Object... params) { log.logf(FQCN, Logger.Level.FATAL, null, format, params); } @Override public void fatalf(final String format, final Object param1) { log.logf(FQCN, Logger.Level.FATAL, null, format, param1); } @Override public void fatalf(final String format, final Object param1, final Object param2) { log.logf(FQCN, Logger.Level.FATAL, null, format, param1, param2); } @Override public void fatalf(final String format, final Object param1, final Object param2, final Object param3) { log.logf(FQCN, Logger.Level.FATAL, null, format, param1, param2, param3); } @Override public void fatalf(final Throwable t, final String format, final Object... params) { log.logf(FQCN, Logger.Level.FATAL, t, format, params); } @Override public void fatalf(final Throwable t, final String format, final Object param1) { log.logf(FQCN, Logger.Level.FATAL, t, format, param1); } @Override public void fatalf(final Throwable t, final String format, final Object param1, final Object param2) { log.logf(FQCN, Logger.Level.FATAL, t, format, param1, param2); } @Override public void fatalf(final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { log.logf(FQCN, Logger.Level.FATAL, t, format, param1, param2, param3); } @Override public void log(final Logger.Level level, final Object message) { log.log(FQCN, level, message, null, null); } @Override public void log(final Logger.Level level, final Object message, final Throwable t) { log.log(FQCN, level, message, null, t); } @Override public void log(final Logger.Level level, final String loggerFqcn, final Object message, final Throwable t) { log.log(level, loggerFqcn, message, t); } @Override public void log(final String loggerFqcn, final Logger.Level level, final Object message, final Object[] params, final Throwable t) { log.log(loggerFqcn, level, message, params, t); } @Override public void logv(final Logger.Level level, final String format, final Object... params) { log.logv(FQCN, level, null, format, params); } @Override public void logv(final Logger.Level level, final String format, final Object param1) { log.logv(FQCN, level, null, format, param1); } @Override public void logv(final Logger.Level level, final String format, final Object param1, final Object param2) { log.logv(FQCN, level, null, format, param1, param2); } @Override public void logv(final Logger.Level level, final String format, final Object param1, final Object param2, final Object param3) { log.logv(FQCN, level, null, format, param1, param2, param3); } @Override public void logv(final Logger.Level level, final Throwable t, final String format, final Object... params) { log.logv(FQCN, level, t, format, params); } @Override public void logv(final Logger.Level level, final Throwable t, final String format, final Object param1) { log.logv(FQCN, level, t, format, param1); } @Override public void logv(final Logger.Level level, final Throwable t, final String format, final Object param1, final Object param2) { log.logv(FQCN, level, t, format, param1, param2); } @Override public void logv(final Logger.Level level, final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { log.logv(FQCN, level, t, format, param1, param2, param3); } @Override public void logv(final String loggerFqcn, final Logger.Level level, final Throwable t, final String format, final Object... params) { log.logv(loggerFqcn, level, t, format, params); } @Override public void logv(final String loggerFqcn, final Logger.Level level, final Throwable t, final String format, final Object param1) { log.logv(loggerFqcn, level, t, format, param1); } @Override public void logv(final String loggerFqcn, final Logger.Level level, final Throwable t, final String format, final Object param1, final Object param2) { log.logv(loggerFqcn, level, t, format, param1, param2); } @Override public void logv(final String loggerFqcn, final Logger.Level level, final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { log.logv(loggerFqcn, level, t, format, param1, param2, param3); } @Override public void logf(final Logger.Level level, final String format, final Object... params) { log.logf(FQCN, level, null, format, params); } @Override public void logf(final Logger.Level level, final String format, final Object param1) { log.logf(FQCN, level, null, format, param1); } @Override public void logf(final Logger.Level level, final String format, final Object param1, final Object param2) { log.logf(FQCN, level, null, format, param1, param2); } @Override public void logf(final Logger.Level level, final String format, final Object param1, final Object param2, final Object param3) { log.logf(FQCN, level, null, format, param1, param2, param3); } @Override public void logf(final Logger.Level level, final Throwable t, final String format, final Object... params) { log.logf(FQCN, level, t, format, params); } @Override public void logf(final Logger.Level level, final Throwable t, final String format, final Object param1) { log.logf(FQCN, level, t, format, param1); } @Override public void logf(final Logger.Level level, final Throwable t, final String format, final Object param1, final Object param2) { log.logf(FQCN, level, t, format, param1, param2); } @Override public void logf(final Logger.Level level, final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { log.logf(FQCN, level, t, format, param1, param2, param3); } @Override public void logf(final String loggerFqcn, final Logger.Level level, final Throwable t, final String format, final Object param1) { log.logf(loggerFqcn, level, t, format, param1); } @Override public void logf(final String loggerFqcn, final Logger.Level level, final Throwable t, final String format, final Object param1, final Object param2) { log.logf(loggerFqcn, level, t, format, param1, param2); } @Override public void logf(final String loggerFqcn, final Logger.Level level, final Throwable t, final String format, final Object param1, final Object param2, final Object param3) { log.logf(loggerFqcn, level, t, format, param1, param2, param3); } @Override public void logf(final String loggerFqcn, final Logger.Level level, final Throwable t, final String format, final Object... params) { log.logf(loggerFqcn, level, t, format, params); } @Override public boolean isEnabled(final Logger.Level level) { return log.isEnabled(level); } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/JBossLogManagerLogger.java000066400000000000000000000056411416737514500303110ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc. * * Licensed 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.jboss.logging; import org.jboss.logmanager.ExtLogRecord; final class JBossLogManagerLogger extends Logger { private static final long serialVersionUID = 7429618317727584742L; private final org.jboss.logmanager.Logger logger; JBossLogManagerLogger(final String name, final org.jboss.logmanager.Logger logger) { super(name); this.logger = logger; } public boolean isEnabled(final Level level) { return logger.isLoggable(translate(level)); } protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) { java.util.logging.Level translatedLevel = translate(level); if (logger.isLoggable(translatedLevel)) { if (parameters == null) { logger.log(loggerClassName, translatedLevel, String.valueOf(message), thrown); } else { logger.log(loggerClassName, translatedLevel, String.valueOf(message), ExtLogRecord.FormatStyle.MESSAGE_FORMAT, parameters, thrown); } } } protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) { if (parameters == null) { logger.log(loggerClassName, translate(level), format, thrown); } else { logger.log(loggerClassName, translate(level), format, ExtLogRecord.FormatStyle.PRINTF, parameters, thrown); } } private static java.util.logging.Level translate(final Level level) { if (level == Level.TRACE) { return org.jboss.logmanager.Level.TRACE; } else if (level == Level.DEBUG) { return org.jboss.logmanager.Level.DEBUG; } return infoOrHigher(level); } private static java.util.logging.Level infoOrHigher(final Level level) { if (level == Level.INFO) { return org.jboss.logmanager.Level.INFO; } else if (level == Level.WARN) { return org.jboss.logmanager.Level.WARN; } else if (level == Level.ERROR) { return org.jboss.logmanager.Level.ERROR; } else if (level == Level.FATAL) { return org.jboss.logmanager.Level.FATAL; } return org.jboss.logmanager.Level.ALL; } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/JBossLogManagerProvider.java000066400000000000000000000107211416737514500306570ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import org.jboss.logmanager.LogContext; import org.jboss.logmanager.MDC; import org.jboss.logmanager.NDC; import static org.jboss.logmanager.Logger.AttachmentKey; final class JBossLogManagerProvider implements LoggerProvider { private static final AttachmentKey KEY = new AttachmentKey(); private static final AttachmentKey> LEGACY_KEY = new AttachmentKey>(); public Logger getLogger(final String name) { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { return AccessController.doPrivileged(new PrivilegedAction() { public Logger run() { try { return doGetLogger(name) ; } catch (NoSuchMethodError ignore) { } // fallback return doLegacyGetLogger(name); } }); } else { try { return doGetLogger(name) ; } catch (NoSuchMethodError ignore) { } // fallback return doLegacyGetLogger(name); } } private static Logger doLegacyGetLogger(final String name) { final org.jboss.logmanager.Logger lmLogger = LogContext.getLogContext().getLogger(""); ConcurrentMap loggers = lmLogger.getAttachment(LEGACY_KEY); if (loggers == null) { loggers = new ConcurrentHashMap(); final ConcurrentMap appearing = lmLogger.attachIfAbsent(LEGACY_KEY, loggers); if (appearing != null) { loggers = appearing; } } Logger l = loggers.get(name); if (l != null) { return l; } final org.jboss.logmanager.Logger logger = org.jboss.logmanager.Logger.getLogger(name); l = new JBossLogManagerLogger(name, logger); final Logger appearing = loggers.putIfAbsent(name, l); if (appearing == null) { return l; } return appearing; } private static Logger doGetLogger(final String name) { Logger l = LogContext.getLogContext().getAttachment(name, KEY); if (l != null) { return l; } final org.jboss.logmanager.Logger logger = org.jboss.logmanager.Logger.getLogger(name); l = new JBossLogManagerLogger(name, logger); Logger a = logger.attachIfAbsent(KEY, l); if (a == null) { return l; } else { return a; } } public void clearMdc() { MDC.clear(); } public Object putMdc(final String key, final Object value) { return MDC.put(key, String.valueOf(value)); } public Object getMdc(final String key) { return MDC.get(key); } public void removeMdc(final String key) { MDC.remove(key); } @SuppressWarnings({ "unchecked" }) public Map getMdcMap() { // we can re-define the erasure of this map because MDC does not make further use of the copy return (Map)MDC.copy(); } public void clearNdc() { NDC.clear(); } public String getNdc() { return NDC.get(); } public int getNdcDepth() { return NDC.getDepth(); } public String popNdc() { return NDC.pop(); } public String peekNdc() { return NDC.get(); } public void pushNdc(final String message) { NDC.push(message); } public void setNdcMaxDepth(final int maxDepth) { NDC.trimTo(maxDepth); } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/JBossLogRecord.java000066400000000000000000000064121416737514500270120ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.util.logging.Level; import java.util.logging.LogRecord; class JBossLogRecord extends LogRecord { private static final long serialVersionUID = 2492784413065296060L; private static final String LOGGER_CLASS_NAME = Logger.class.getName(); private boolean resolved; private final String loggerClassName; JBossLogRecord(final Level level, final String msg) { super(level, msg); loggerClassName = LOGGER_CLASS_NAME; } JBossLogRecord(final Level level, final String msg, final String loggerClassName) { super(level, msg); this.loggerClassName = loggerClassName; } public String getSourceClassName() { if (! resolved) { resolve(); } return super.getSourceClassName(); } public void setSourceClassName(final String sourceClassName) { resolved = true; super.setSourceClassName(sourceClassName); } public String getSourceMethodName() { if (! resolved) { resolve(); } return super.getSourceMethodName(); } public void setSourceMethodName(final String sourceMethodName) { resolved = true; super.setSourceMethodName(sourceMethodName); } private void resolve() { resolved = true; final StackTraceElement[] stack = new Throwable().getStackTrace(); boolean found = false; for (StackTraceElement element : stack) { final String className = element.getClassName(); if (found) { if (! loggerClassName.equals(className)) { setSourceClassName(className); setSourceMethodName(element.getMethodName()); return; } } else { found = loggerClassName.equals(className); } } setSourceClassName(""); setSourceMethodName(""); } protected Object writeReplace() { final LogRecord replacement = new LogRecord(getLevel(), getMessage()); replacement.setResourceBundle(getResourceBundle()); replacement.setLoggerName(getLoggerName()); replacement.setMillis(getMillis()); replacement.setParameters(getParameters()); replacement.setResourceBundleName(getResourceBundleName()); replacement.setSequenceNumber(getSequenceNumber()); replacement.setSourceClassName(getSourceClassName()); replacement.setSourceMethodName(getSourceMethodName()); replacement.setThreadID(getThreadID()); replacement.setThrown(getThrown()); return replacement; } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/JDKLevel.java000066400000000000000000000030051416737514500255640ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.util.logging.Level; /** * Levels used by the JDK logging back end. */ final class JDKLevel extends Level { private static final long serialVersionUID = 1L; protected JDKLevel(final String name, final int value) { super(name, value); } protected JDKLevel(final String name, final int value, final String resourceBundleName) { super(name, value, resourceBundleName); } public static final JDKLevel FATAL = new JDKLevel("FATAL", 1100); public static final JDKLevel ERROR = new JDKLevel("ERROR", 1000); public static final JDKLevel WARN = new JDKLevel("WARN", 900); @SuppressWarnings("hiding") public static final JDKLevel INFO = new JDKLevel("INFO", 800); public static final JDKLevel DEBUG = new JDKLevel("DEBUG", 500); public static final JDKLevel TRACE = new JDKLevel("TRACE", 400); } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/JDKLogger.java000066400000000000000000000070061416737514500257410ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.util.MissingResourceException; import java.util.ResourceBundle; final class JDKLogger extends Logger { private static final long serialVersionUID = 2563174097983721393L; @SuppressWarnings({ "NonConstantLogger" }) private transient final java.util.logging.Logger logger; public JDKLogger(final String name) { super(name); logger = java.util.logging.Logger.getLogger(name); } protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) { if (isEnabled(level)) try { final JBossLogRecord rec = new JBossLogRecord(translate(level), String.valueOf(message), loggerClassName); if (thrown != null) rec.setThrown(thrown); rec.setLoggerName(getName()); rec.setParameters(parameters); rec.setResourceBundleName(logger.getResourceBundleName()); rec.setResourceBundle(logger.getResourceBundle()); logger.log(rec); } catch (Throwable ignored) {} } protected void doLogf(final Level level, final String loggerClassName, String format, final Object[] parameters, final Throwable thrown) { if (isEnabled(level)) try { final ResourceBundle resourceBundle = logger.getResourceBundle(); if (resourceBundle != null) try { format = resourceBundle.getString(format); } catch (MissingResourceException e) { // ignore } final String msg = parameters == null ? String.format(format) : String.format(format, parameters); final JBossLogRecord rec = new JBossLogRecord(translate(level), msg, loggerClassName); if (thrown != null) rec.setThrown(thrown); rec.setLoggerName(getName()); rec.setResourceBundleName(logger.getResourceBundleName()); // we've done all the business rec.setResourceBundle(null); rec.setParameters(null); logger.log(rec); } catch (Throwable ignored) {} } private static java.util.logging.Level translate(final Level level) { if (level == Level.TRACE) { return JDKLevel.TRACE; } else if (level == Level.DEBUG) { return JDKLevel.DEBUG; } return infoOrHigher(level); } private static java.util.logging.Level infoOrHigher(final Level level) { if (level == Level.INFO) { return JDKLevel.INFO; } else if (level == Level.WARN) { return JDKLevel.WARN; } else if (level == Level.ERROR) { return JDKLevel.ERROR; } else if (level == Level.FATAL) { return JDKLevel.FATAL; } return JDKLevel.ALL; } public boolean isEnabled(final Level level) { return logger.isLoggable(translate(level)); } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/JDKLoggerProvider.java000066400000000000000000000015331416737514500274530ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc. * * Licensed 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.jboss.logging; final class JDKLoggerProvider extends AbstractMdcLoggerProvider implements LoggerProvider { public Logger getLogger(final String name) { return new JDKLogger(name); } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/Log4j2Logger.java000066400000000000000000000074441416737514500264000ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2013 Red Hat, Inc. * * Licensed 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.jboss.logging; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LoggingException; import org.apache.logging.log4j.message.MessageFormatMessageFactory; import org.apache.logging.log4j.message.StringFormattedMessage; import org.apache.logging.log4j.spi.AbstractLogger; final class Log4j2Logger extends Logger { private static final long serialVersionUID = -2507841068232627725L; private final AbstractLogger logger; private final MessageFormatMessageFactory messageFactory; Log4j2Logger(final String name) { super(name); org.apache.logging.log4j.Logger logger = LogManager.getLogger(name); if (!(logger instanceof AbstractLogger)) { throw new LoggingException("The logger for [" + name + "] does not extend AbstractLogger. Actual logger: " + logger.getClass().getName()); } this.logger = (AbstractLogger)logger; this.messageFactory = new MessageFormatMessageFactory(); } @Override public boolean isEnabled(final Level level) { return this.logger.isEnabled(Log4j2Logger.translate(level)); } @Override protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) { final org.apache.logging.log4j.Level translatedLevel = Log4j2Logger.translate(level); if (this.logger.isEnabled(translatedLevel)) { try { this.logger.logMessage(loggerClassName, translatedLevel, null, (parameters == null || parameters.length == 0) ? this.messageFactory.newMessage(String.valueOf(message)) : this.messageFactory.newMessage(String.valueOf(message), parameters), thrown); } catch (Throwable ignored) { } } } @Override protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) { final org.apache.logging.log4j.Level translatedLevel = Log4j2Logger.translate(level); if (this.logger.isEnabled(translatedLevel)) { try { this.logger.logMessage(loggerClassName, translatedLevel, null, new StringFormattedMessage(format, parameters), thrown); } catch (Throwable ignored) { } } } private static org.apache.logging.log4j.Level translate(final Level level) { if (level == Level.TRACE) { return org.apache.logging.log4j.Level.TRACE; } else if (level == Level.DEBUG) { return org.apache.logging.log4j.Level.DEBUG; } return infoOrHigher(level); } private static org.apache.logging.log4j.Level infoOrHigher(final Level level) { if (level == Level.INFO) { return org.apache.logging.log4j.Level.INFO; } else if (level == Level.WARN) { return org.apache.logging.log4j.Level.WARN; } else if (level == Level.ERROR) { return org.apache.logging.log4j.Level.ERROR; } else if (level == Level.FATAL) { return org.apache.logging.log4j.Level.FATAL; } return org.apache.logging.log4j.Level.ALL; } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/Log4j2LoggerProvider.java000066400000000000000000000042721416737514500301070ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2013 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.util.HashMap; import java.util.Map; import org.apache.logging.log4j.ThreadContext; final class Log4j2LoggerProvider implements LoggerProvider { @Override public Log4j2Logger getLogger(String name) { return new Log4j2Logger(name); } @Override public void clearMdc() { ThreadContext.clearMap(); } @Override public Object putMdc(String key, Object value) { try { return ThreadContext.get(key); } finally { ThreadContext.put(key, String.valueOf(value)); } } @Override public Object getMdc(String key) { return ThreadContext.get(key); } @Override public void removeMdc(String key) { ThreadContext.remove(key); } @Override public Map getMdcMap() { return new HashMap(ThreadContext.getImmutableContext()); } @Override public void clearNdc() { ThreadContext.clearStack(); } @Override public String getNdc() { return ThreadContext.peek(); } @Override public int getNdcDepth() { return ThreadContext.getDepth(); } @Override public String popNdc() { return ThreadContext.pop(); } @Override public String peekNdc() { return ThreadContext.peek(); } @Override public void pushNdc(String message) { ThreadContext.push(message); } @Override public void setNdcMaxDepth(int maxDepth) { ThreadContext.trim(maxDepth); } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/Log4jLogger.java000066400000000000000000000056351416737514500263160ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.text.MessageFormat; final class Log4jLogger extends Logger { private static final long serialVersionUID = -5446154366955151335L; private final org.apache.log4j.Logger logger; Log4jLogger(final String name) { super(name); logger = org.apache.log4j.Logger.getLogger(name); } public boolean isEnabled(final Level level) { final org.apache.log4j.Level l = translate(level); return logger.isEnabledFor(l) && l.isGreaterOrEqual(logger.getEffectiveLevel()); } protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) { final org.apache.log4j.Level translatedLevel = translate(level); if (logger.isEnabledFor(translatedLevel)) try { logger.log(loggerClassName, translatedLevel, parameters == null || parameters.length == 0 ? message : MessageFormat.format(String.valueOf(message), parameters), thrown); } catch (Throwable ignored) {} } protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) { final org.apache.log4j.Level translatedLevel = translate(level); if (logger.isEnabledFor(translatedLevel)) try { logger.log(loggerClassName, translatedLevel, parameters == null ? String.format(format) : String.format(format, parameters), thrown); } catch (Throwable ignored) {} } private static org.apache.log4j.Level translate(final Level level) { if (level == Level.TRACE) { return org.apache.log4j.Level.TRACE; } else if (level == Level.DEBUG) { return org.apache.log4j.Level.DEBUG; } return infoOrHigher(level); } private static org.apache.log4j.Level infoOrHigher(final Level level) { if (level == Level.INFO) { return org.apache.log4j.Level.INFO; } else if (level == Level.WARN) { return org.apache.log4j.Level.WARN; } else if (level == Level.ERROR) { return org.apache.log4j.Level.ERROR; } else if (level == Level.FATAL) { return org.apache.log4j.Level.FATAL; } return org.apache.log4j.Level.ALL; } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/Log4jLoggerProvider.java000066400000000000000000000037721416737514500300310ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.util.Collections; import java.util.Map; import org.apache.log4j.MDC; import org.apache.log4j.NDC; final class Log4jLoggerProvider implements LoggerProvider { public Logger getLogger(final String name) { return new Log4jLogger("".equals(name) ? "ROOT" : name); } public void clearMdc() { MDC.clear(); } public Object getMdc(String key) { return MDC.get(key); } public Map getMdcMap() { @SuppressWarnings("unchecked") final Map map = MDC.getContext(); return map == null ? Collections.emptyMap() : map; } public Object putMdc(String key, Object val) { try { return MDC.get(key); } finally { MDC.put(key, val); } } public void removeMdc(String key) { MDC.remove(key); } public void clearNdc() { NDC.remove(); } public String getNdc() { return NDC.get(); } public int getNdcDepth() { return NDC.getDepth(); } public String peekNdc() { return NDC.peek(); } public String popNdc() { return NDC.pop(); } public void pushNdc(String message) { NDC.push(message); } public void setNdcMaxDepth(int maxDepth) { NDC.setMaxDepth(maxDepth); } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/Logger.java000066400000000000000000002646331416737514500254230ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2011 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.io.Serializable; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.security.PrivilegedAction; import java.util.Locale; import static java.security.AccessController.doPrivileged; /** * An abstracted logging entry point. */ public abstract class Logger implements Serializable, BasicLogger { private static final long serialVersionUID = 4232175575988879434L; private static final String FQCN = Logger.class.getName(); /** * Levels used by this logging API. */ public enum Level { FATAL, ERROR, WARN, INFO, DEBUG, TRACE, } private final String name; /** * Construct a new instance. * * @param name the logger category name */ protected Logger(final String name) { this.name = name; } /** * Return the name of this logger. * * @return The name of this logger. */ public String getName() { return name; } /** * Implementation log method (standard parameter formatting). * * @param level the level * @param loggerClassName the logger class name * @param message the message to log * @param parameters the parameters of the message * @param thrown the exception which was thrown, if any */ protected abstract void doLog(Level level, String loggerClassName, Object message, Object[] parameters, Throwable thrown); /** * Implementation log method (printf formatting). * * @param level the level * @param loggerClassName the logger class name * @param format the format string to log * @param parameters the parameters of the message * @param thrown the exception which was thrown, if any */ protected abstract void doLogf(Level level, String loggerClassName, String format, Object[] parameters, Throwable thrown); /** * Check to see if the {@code TRACE} level is enabled for this logger. * * @return {@code true} if messages logged at {@link Level#TRACE} may be accepted, {@code false} otherwise */ public boolean isTraceEnabled() { return isEnabled(Level.TRACE); } /** * Issue a log message with a level of TRACE. * * @param message the message */ public void trace(Object message) { doLog(Level.TRACE, FQCN, message, null, null); } /** * Issue a log message and throwable with a level of TRACE. * * @param message the message * @param t the throwable */ public void trace(Object message, Throwable t) { doLog(Level.TRACE, FQCN, message, null, t); } /** * Issue a log message and throwable with a level of TRACE and a specific logger class name. * * @param loggerFqcn the logger class name * @param message the message * @param t the throwable */ public void trace(String loggerFqcn, Object message, Throwable t) { doLog(Level.TRACE, loggerFqcn, message, null, t); } /** * Issue a log message with parameters with a level of TRACE. * * @param message the message * @param params the message parameters * @deprecated To log a message with parameters, using {@link #tracev(String, Object...)} is recommended. */ @Deprecated public void trace(Object message, Object[] params) { doLog(Level.TRACE, FQCN, message, params, null); } /** * Issue a log message with parameters and a throwable with a level of TRACE. * * @param message the message * @param params the message parameters * @param t the throwable * @deprecated To log a message with parameters, using {@link #tracev(Throwable, String, Object...)} is recommended. */ @Deprecated public void trace(Object message, Object[] params, Throwable t) { doLog(Level.TRACE, FQCN, message, params, t); } /** * Issue a log message with parameters and a throwable with a level of TRACE. * * @param loggerFqcn the logger class name * @param message the message * @param params the message parameters * @param t the throwable */ public void trace(String loggerFqcn, Object message, Object[] params, Throwable t) { doLog(Level.TRACE, loggerFqcn, message, params, t); } /** * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param params the parameters */ public void tracev(String format, Object... params) { doLog(Level.TRACE, FQCN, format, params, null); } /** * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the sole parameter */ public void tracev(String format, Object param1) { if (isEnabled(Level.TRACE)) { doLog(Level.TRACE, FQCN, format, new Object[] { param1 }, null); } } /** * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ public void tracev(String format, Object param1, Object param2) { if (isEnabled(Level.TRACE)) { doLog(Level.TRACE, FQCN, format, new Object[] { param1, param2 }, null); } } /** * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void tracev(String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.TRACE)) { doLog(Level.TRACE, FQCN, format, new Object[] { param1, param2, param3 }, null); } } /** * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param params the parameters */ public void tracev(Throwable t, String format, Object... params) { doLog(Level.TRACE, FQCN, format, params, t); } /** * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the sole parameter */ public void tracev(Throwable t, String format, Object param1) { if (isEnabled(Level.TRACE)) { doLog(Level.TRACE, FQCN, format, new Object[] { param1 }, t); } } /** * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ public void tracev(Throwable t, String format, Object param1, Object param2) { if (isEnabled(Level.TRACE)) { doLog(Level.TRACE, FQCN, format, new Object[] { param1, param2 }, t); } } /** * Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void tracev(Throwable t, String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.TRACE)) { doLog(Level.TRACE, FQCN, format, new Object[] { param1, param2, param3 }, t); } } /** * Issue a formatted log message with a level of TRACE. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param params the parameters */ public void tracef(String format, Object... params) { doLogf(Level.TRACE, FQCN, format, params, null); } /** * Issue a formatted log message with a level of TRACE. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the sole parameter */ public void tracef(String format, Object param1) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { param1 }, null); } } /** * Issue a formatted log message with a level of TRACE. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter */ public void tracef(String format, Object param1, Object param2) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { param1, param2 }, null); } } /** * Issue a formatted log message with a level of TRACE. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void tracef(String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { param1, param2, param3 }, null); } } /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param params the parameters */ public void tracef(Throwable t, String format, Object... params) { doLogf(Level.TRACE, FQCN, format, params, t); } /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the sole parameter */ public void tracef(Throwable t, String format, Object param1) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { param1 }, t); } } /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter */ public void tracef(Throwable t, String format, Object param1, Object param2) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { param1, param2 }, t); } } /** * Issue a formatted log message with a level of TRACE. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void tracef(Throwable t, String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { param1, param2, param3 }, t); } } public void tracef(final String format, final int arg) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg }, null); } } public void tracef(final String format, final int arg1, final int arg2) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2 }, null); } } public void tracef(final String format, final int arg1, final Object arg2) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2 }, null); } } public void tracef(final String format, final int arg1, final int arg2, final int arg3) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); } } public void tracef(final String format, final int arg1, final int arg2, final Object arg3) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); } } public void tracef(final String format, final int arg1, final Object arg2, final Object arg3) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); } } public void tracef(final Throwable t, final String format, final int arg) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg }, t); } } public void tracef(final Throwable t, final String format, final int arg1, final int arg2) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2 }, t); } } public void tracef(final Throwable t, final String format, final int arg1, final Object arg2) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2 }, t); } } public void tracef(final Throwable t, final String format, final int arg1, final int arg2, final int arg3) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); } } public void tracef(final Throwable t, final String format, final int arg1, final int arg2, final Object arg3) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); } } public void tracef(final Throwable t, final String format, final int arg1, final Object arg2, final Object arg3) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); } } public void tracef(final String format, final long arg) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg }, null); } } public void tracef(final String format, final long arg1, final long arg2) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2 }, null); } } public void tracef(final String format, final long arg1, final Object arg2) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2 }, null); } } public void tracef(final String format, final long arg1, final long arg2, final long arg3) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); } } public void tracef(final String format, final long arg1, final long arg2, final Object arg3) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); } } public void tracef(final String format, final long arg1, final Object arg2, final Object arg3) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); } } public void tracef(final Throwable t, final String format, final long arg) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg }, t); } } public void tracef(final Throwable t, final String format, final long arg1, final long arg2) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2 }, t); } } public void tracef(final Throwable t, final String format, final long arg1, final Object arg2) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2 }, t); } } public void tracef(final Throwable t, final String format, final long arg1, final long arg2, final long arg3) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); } } public void tracef(final Throwable t, final String format, final long arg1, final long arg2, final Object arg3) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); } } public void tracef(final Throwable t, final String format, final long arg1, final Object arg2, final Object arg3) { if (isEnabled(Level.TRACE)) { doLogf(Level.TRACE, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); } } /** * Check to see if the {@code DEBUG} level is enabled for this logger. * * @return {@code true} if messages logged at {@link Level#DEBUG} may be accepted, {@code false} otherwise */ public boolean isDebugEnabled() { return isEnabled(Level.DEBUG); } /** * Issue a log message with a level of DEBUG. * * @param message the message */ public void debug(Object message) { doLog(Level.DEBUG, FQCN, message, null, null); } /** * Issue a log message and throwable with a level of DEBUG. * * @param message the message * @param t the throwable */ public void debug(Object message, Throwable t) { doLog(Level.DEBUG, FQCN, message, null, t); } /** * Issue a log message and throwable with a level of DEBUG and a specific logger class name. * * @param loggerFqcn the logger class name * @param message the message * @param t the throwable */ public void debug(String loggerFqcn, Object message, Throwable t) { doLog(Level.DEBUG, loggerFqcn, message, null, t); } /** * Issue a log message with parameters with a level of DEBUG. * * @param message the message * @param params the message parameters * @deprecated To log a message with parameters, using {@link #debugv(String, Object...)} is recommended. */ @Deprecated public void debug(Object message, Object[] params) { doLog(Level.DEBUG, FQCN, message, params, null); } /** * Issue a log message with parameters and a throwable with a level of DEBUG. * * @param message the message * @param params the message parameters * @param t the throwable * @deprecated To log a message with parameters, using {@link #debugv(Throwable, String, Object...)} is recommended. */ @Deprecated public void debug(Object message, Object[] params, Throwable t) { doLog(Level.DEBUG, FQCN, message, params, t); } /** * Issue a log message with parameters and a throwable with a level of DEBUG. * * @param loggerFqcn the logger class name * @param message the message * @param params the message parameters * @param t the throwable */ public void debug(String loggerFqcn, Object message, Object[] params, Throwable t) { doLog(Level.DEBUG, loggerFqcn, message, params, t); } /** * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param params the parameters */ public void debugv(String format, Object... params) { doLog(Level.DEBUG, FQCN, format, params, null); } /** * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the sole parameter */ public void debugv(String format, Object param1) { if (isEnabled(Level.DEBUG)) { doLog(Level.DEBUG, FQCN, format, new Object[] { param1 }, null); } } /** * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ public void debugv(String format, Object param1, Object param2) { if (isEnabled(Level.DEBUG)) { doLog(Level.DEBUG, FQCN, format, new Object[] { param1, param2 }, null); } } /** * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void debugv(String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.DEBUG)) { doLog(Level.DEBUG, FQCN, format, new Object[] { param1, param2, param3 }, null); } } /** * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param params the parameters */ public void debugv(Throwable t, String format, Object... params) { doLog(Level.DEBUG, FQCN, format, params, t); } /** * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the sole parameter */ public void debugv(Throwable t, String format, Object param1) { if (isEnabled(Level.DEBUG)) { doLog(Level.DEBUG, FQCN, format, new Object[] { param1 }, t); } } /** * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ public void debugv(Throwable t, String format, Object param1, Object param2) { if (isEnabled(Level.DEBUG)) { doLog(Level.DEBUG, FQCN, format, new Object[] { param1, param2 }, t); } } /** * Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void debugv(Throwable t, String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.DEBUG)) { doLog(Level.DEBUG, FQCN, format, new Object[] { param1, param2, param3 }, t); } } /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param params the parameters */ public void debugf(String format, Object... params) { doLogf(Level.DEBUG, FQCN, format, params, null); } /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the sole parameter */ public void debugf(String format, Object param1) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { param1 }, null); } } /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter */ public void debugf(String format, Object param1, Object param2) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { param1, param2 }, null); } } /** * Issue a formatted log message with a level of DEBUG. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void debugf(String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { param1, param2, param3 }, null); } } /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param params the parameters */ public void debugf(Throwable t, String format, Object... params) { doLogf(Level.DEBUG, FQCN, format, params, t); } /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the sole parameter */ public void debugf(Throwable t, String format, Object param1) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { param1 }, t); } } /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter */ public void debugf(Throwable t, String format, Object param1, Object param2) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { param1, param2 }, t); } } /** * Issue a formatted log message with a level of DEBUG. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void debugf(Throwable t, String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { param1, param2, param3 }, t); } } public void debugf(final String format, final int arg) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg }, null); } } public void debugf(final String format, final int arg1, final int arg2) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2 }, null); } } public void debugf(final String format, final int arg1, final Object arg2) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2 }, null); } } public void debugf(final String format, final int arg1, final int arg2, final int arg3) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); } } public void debugf(final String format, final int arg1, final int arg2, final Object arg3) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); } } public void debugf(final String format, final int arg1, final Object arg2, final Object arg3) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); } } public void debugf(final Throwable t, final String format, final int arg) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg }, t); } } public void debugf(final Throwable t, final String format, final int arg1, final int arg2) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2 }, t); } } public void debugf(final Throwable t, final String format, final int arg1, final Object arg2) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2 }, t); } } public void debugf(final Throwable t, final String format, final int arg1, final int arg2, final int arg3) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); } } public void debugf(final Throwable t, final String format, final int arg1, final int arg2, final Object arg3) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); } } public void debugf(final Throwable t, final String format, final int arg1, final Object arg2, final Object arg3) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); } } public void debugf(final String format, final long arg) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg }, null); } } public void debugf(final String format, final long arg1, final long arg2) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2 }, null); } } public void debugf(final String format, final long arg1, final Object arg2) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2 }, null); } } public void debugf(final String format, final long arg1, final long arg2, final long arg3) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); } } public void debugf(final String format, final long arg1, final long arg2, final Object arg3) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); } } public void debugf(final String format, final long arg1, final Object arg2, final Object arg3) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, null); } } public void debugf(final Throwable t, final String format, final long arg) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg }, t); } } public void debugf(final Throwable t, final String format, final long arg1, final long arg2) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2 }, t); } } public void debugf(final Throwable t, final String format, final long arg1, final Object arg2) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2 }, t); } } public void debugf(final Throwable t, final String format, final long arg1, final long arg2, final long arg3) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); } } public void debugf(final Throwable t, final String format, final long arg1, final long arg2, final Object arg3) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); } } public void debugf(final Throwable t, final String format, final long arg1, final Object arg2, final Object arg3) { if (isEnabled(Level.DEBUG)) { doLogf(Level.DEBUG, FQCN, format, new Object[] { arg1, arg2, arg3 }, t); } } /** * Check to see if the {@code INFO} level is enabled for this logger. * * @return {@code true} if messages logged at {@link Level#INFO} may be accepted, {@code false} otherwise */ public boolean isInfoEnabled() { return isEnabled(Level.INFO); } /** * Issue a log message with a level of INFO. * * @param message the message */ public void info(Object message) { doLog(Level.INFO, FQCN, message, null, null); } /** * Issue a log message and throwable with a level of INFO. * * @param message the message * @param t the throwable */ public void info(Object message, Throwable t) { doLog(Level.INFO, FQCN, message, null, t); } /** * Issue a log message and throwable with a level of INFO and a specific logger class name. * * @param loggerFqcn the logger class name * @param message the message * @param t the throwable */ public void info(String loggerFqcn, Object message, Throwable t) { doLog(Level.INFO, loggerFqcn, message, null, t); } /** * Issue a log message with parameters with a level of INFO. * * @param message the message * @param params the message parameters * @deprecated To log a message with parameters, using {@link #infov(String, Object...)} is recommended. */ @Deprecated public void info(Object message, Object[] params) { doLog(Level.INFO, FQCN, message, params, null); } /** * Issue a log message with parameters and a throwable with a level of INFO. * * @param message the message * @param params the message parameters * @param t the throwable * @deprecated To log a message with parameters, using {@link #infov(Throwable, String, Object...)} is recommended. */ @Deprecated public void info(Object message, Object[] params, Throwable t) { doLog(Level.INFO, FQCN, message, params, t); } /** * Issue a log message with parameters and a throwable with a level of INFO. * * @param loggerFqcn the logger class name * @param message the message * @param params the message parameters * @param t the throwable */ public void info(String loggerFqcn, Object message, Object[] params, Throwable t) { doLog(Level.INFO, loggerFqcn, message, params, t); } /** * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param params the parameters */ public void infov(String format, Object... params) { doLog(Level.INFO, FQCN, format, params, null); } /** * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the sole parameter */ public void infov(String format, Object param1) { if (isEnabled(Level.INFO)) { doLog(Level.INFO, FQCN, format, new Object[] { param1 }, null); } } /** * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ public void infov(String format, Object param1, Object param2) { if (isEnabled(Level.INFO)) { doLog(Level.INFO, FQCN, format, new Object[] { param1, param2 }, null); } } /** * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void infov(String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.INFO)) { doLog(Level.INFO, FQCN, format, new Object[] { param1, param2, param3 }, null); } } /** * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param params the parameters */ public void infov(Throwable t, String format, Object... params) { doLog(Level.INFO, FQCN, format, params, t); } /** * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the sole parameter */ public void infov(Throwable t, String format, Object param1) { if (isEnabled(Level.INFO)) { doLog(Level.INFO, FQCN, format, new Object[] { param1 }, t); } } /** * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ public void infov(Throwable t, String format, Object param1, Object param2) { if (isEnabled(Level.INFO)) { doLog(Level.INFO, FQCN, format, new Object[] { param1, param2 }, t); } } /** * Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void infov(Throwable t, String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.INFO)) { doLog(Level.INFO, FQCN, format, new Object[] { param1, param2, param3 }, t); } } /** * Issue a formatted log message with a level of INFO. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param params the parameters */ public void infof(String format, Object... params) { doLogf(Level.INFO, FQCN, format, params, null); } /** * Issue a formatted log message with a level of INFO. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the sole parameter */ public void infof(String format, Object param1) { if (isEnabled(Level.INFO)) { doLogf(Level.INFO, FQCN, format, new Object[] { param1 }, null); } } /** * Issue a formatted log message with a level of INFO. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter */ public void infof(String format, Object param1, Object param2) { if (isEnabled(Level.INFO)) { doLogf(Level.INFO, FQCN, format, new Object[] { param1, param2 }, null); } } /** * Issue a formatted log message with a level of INFO. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void infof(String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.INFO)) { doLogf(Level.INFO, FQCN, format, new Object[] { param1, param2, param3 }, null); } } /** * Issue a formatted log message with a level of INFO. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param params the parameters */ public void infof(Throwable t, String format, Object... params) { doLogf(Level.INFO, FQCN, format, params, t); } /** * Issue a formatted log message with a level of INFO. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the sole parameter */ public void infof(Throwable t, String format, Object param1) { if (isEnabled(Level.INFO)) { doLogf(Level.INFO, FQCN, format, new Object[] { param1 }, t); } } /** * Issue a formatted log message with a level of INFO. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter */ public void infof(Throwable t, String format, Object param1, Object param2) { if (isEnabled(Level.INFO)) { doLogf(Level.INFO, FQCN, format, new Object[] { param1, param2 }, t); } } /** * Issue a formatted log message with a level of INFO. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void infof(Throwable t, String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.INFO)) { doLogf(Level.INFO, FQCN, format, new Object[] { param1, param2, param3 }, t); } } /** * Issue a log message with a level of WARN. * * @param message the message */ public void warn(Object message) { doLog(Level.WARN, FQCN, message, null, null); } /** * Issue a log message and throwable with a level of WARN. * * @param message the message * @param t the throwable */ public void warn(Object message, Throwable t) { doLog(Level.WARN, FQCN, message, null, t); } /** * Issue a log message and throwable with a level of WARN and a specific logger class name. * * @param loggerFqcn the logger class name * @param message the message * @param t the throwable */ public void warn(String loggerFqcn, Object message, Throwable t) { doLog(Level.WARN, loggerFqcn, message, null, t); } /** * Issue a log message with parameters with a level of WARN. * * @param message the message * @param params the message parameters * @deprecated To log a message with parameters, using {@link #warnv(String, Object...)} is recommended. */ @Deprecated public void warn(Object message, Object[] params) { doLog(Level.WARN, FQCN, message, params, null); } /** * Issue a log message with parameters and a throwable with a level of WARN. * * @param message the message * @param params the message parameters * @param t the throwable * @deprecated To log a message with parameters, using {@link #warnv(Throwable, String, Object...)} is recommended. */ @Deprecated public void warn(Object message, Object[] params, Throwable t) { doLog(Level.WARN, FQCN, message, params, t); } /** * Issue a log message with parameters and a throwable with a level of WARN. * * @param loggerFqcn the logger class name * @param message the message * @param params the message parameters * @param t the throwable */ public void warn(String loggerFqcn, Object message, Object[] params, Throwable t) { doLog(Level.WARN, loggerFqcn, message, params, t); } /** * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param params the parameters */ public void warnv(String format, Object... params) { doLog(Level.WARN, FQCN, format, params, null); } /** * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the sole parameter */ public void warnv(String format, Object param1) { if (isEnabled(Level.WARN)) { doLog(Level.WARN, FQCN, format, new Object[] { param1 }, null); } } /** * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ public void warnv(String format, Object param1, Object param2) { if (isEnabled(Level.WARN)) { doLog(Level.WARN, FQCN, format, new Object[] { param1, param2 }, null); } } /** * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void warnv(String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.WARN)) { doLog(Level.WARN, FQCN, format, new Object[] { param1, param2, param3 }, null); } } /** * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param params the parameters */ public void warnv(Throwable t, String format, Object... params) { doLog(Level.WARN, FQCN, format, params, t); } /** * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the sole parameter */ public void warnv(Throwable t, String format, Object param1) { if (isEnabled(Level.WARN)) { doLog(Level.WARN, FQCN, format, new Object[] { param1 }, t); } } /** * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ public void warnv(Throwable t, String format, Object param1, Object param2) { if (isEnabled(Level.WARN)) { doLog(Level.WARN, FQCN, format, new Object[] { param1, param2 }, t); } } /** * Issue a log message with a level of WARN using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void warnv(Throwable t, String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.WARN)) { doLog(Level.WARN, FQCN, format, new Object[] { param1, param2, param3 }, t); } } /** * Issue a formatted log message with a level of WARN. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param params the parameters */ public void warnf(String format, Object... params) { doLogf(Level.WARN, FQCN, format, params, null); } /** * Issue a formatted log message with a level of WARN. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the sole parameter */ public void warnf(String format, Object param1) { if (isEnabled(Level.WARN)) { doLogf(Level.WARN, FQCN, format, new Object[] { param1 }, null); } } /** * Issue a formatted log message with a level of WARN. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter */ public void warnf(String format, Object param1, Object param2) { if (isEnabled(Level.WARN)) { doLogf(Level.WARN, FQCN, format, new Object[] { param1, param2 }, null); } } /** * Issue a formatted log message with a level of WARN. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void warnf(String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.WARN)) { doLogf(Level.WARN, FQCN, format, new Object[] { param1, param2, param3 }, null); } } /** * Issue a formatted log message with a level of WARN. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param params the parameters */ public void warnf(Throwable t, String format, Object... params) { doLogf(Level.WARN, FQCN, format, params, t); } /** * Issue a formatted log message with a level of WARN. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the sole parameter */ public void warnf(Throwable t, String format, Object param1) { if (isEnabled(Level.WARN)) { doLogf(Level.WARN, FQCN, format, new Object[] { param1 }, t); } } /** * Issue a formatted log message with a level of WARN. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter */ public void warnf(Throwable t, String format, Object param1, Object param2) { if (isEnabled(Level.WARN)) { doLogf(Level.WARN, FQCN, format, new Object[] { param1, param2 }, t); } } /** * Issue a formatted log message with a level of WARN. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void warnf(Throwable t, String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.WARN)) { doLogf(Level.WARN, FQCN, format, new Object[] { param1, param2, param3 }, t); } } /** * Issue a log message with a level of ERROR. * * @param message the message */ public void error(Object message) { doLog(Level.ERROR, FQCN, message, null, null); } /** * Issue a log message and throwable with a level of ERROR. * * @param message the message * @param t the throwable */ public void error(Object message, Throwable t) { doLog(Level.ERROR, FQCN, message, null, t); } /** * Issue a log message and throwable with a level of ERROR and a specific logger class name. * * @param loggerFqcn the logger class name * @param message the message * @param t the throwable */ public void error(String loggerFqcn, Object message, Throwable t) { doLog(Level.ERROR, loggerFqcn, message, null, t); } /** * Issue a log message with parameters with a level of ERROR. * * @param message the message * @param params the message parameters * @deprecated To log a message with parameters, using {@link #errorv(String, Object...)} is recommended. */ @Deprecated public void error(Object message, Object[] params) { doLog(Level.ERROR, FQCN, message, params, null); } /** * Issue a log message with parameters and a throwable with a level of ERROR. * * @param message the message * @param params the message parameters * @param t the throwable * @deprecated To log a message with parameters, using {@link #errorv(Throwable, String, Object...)} is recommended. */ @Deprecated public void error(Object message, Object[] params, Throwable t) { doLog(Level.ERROR, FQCN, message, params, t); } /** * Issue a log message with parameters and a throwable with a level of ERROR. * * @param loggerFqcn the logger class name * @param message the message * @param params the message parameters * @param t the throwable */ public void error(String loggerFqcn, Object message, Object[] params, Throwable t) { doLog(Level.ERROR, loggerFqcn, message, params, t); } /** * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param params the parameters */ public void errorv(String format, Object... params) { doLog(Level.ERROR, FQCN, format, params, null); } /** * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the sole parameter */ public void errorv(String format, Object param1) { if (isEnabled(Level.ERROR)) { doLog(Level.ERROR, FQCN, format, new Object[] { param1 }, null); } } /** * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ public void errorv(String format, Object param1, Object param2) { if (isEnabled(Level.ERROR)) { doLog(Level.ERROR, FQCN, format, new Object[] { param1, param2 }, null); } } /** * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void errorv(String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.ERROR)) { doLog(Level.ERROR, FQCN, format, new Object[] { param1, param2, param3 }, null); } } /** * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param params the parameters */ public void errorv(Throwable t, String format, Object... params) { doLog(Level.ERROR, FQCN, format, params, t); } /** * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the sole parameter */ public void errorv(Throwable t, String format, Object param1) { if (isEnabled(Level.ERROR)) { doLog(Level.ERROR, FQCN, format, new Object[] { param1 }, t); } } /** * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ public void errorv(Throwable t, String format, Object param1, Object param2) { if (isEnabled(Level.ERROR)) { doLog(Level.ERROR, FQCN, format, new Object[] { param1, param2 }, t); } } /** * Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void errorv(Throwable t, String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.ERROR)) { doLog(Level.ERROR, FQCN, format, new Object[] { param1, param2, param3 }, t); } } /** * Issue a formatted log message with a level of ERROR. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param params the parameters */ public void errorf(String format, Object... params) { doLogf(Level.ERROR, FQCN, format, params, null); } /** * Issue a formatted log message with a level of ERROR. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the sole parameter */ public void errorf(String format, Object param1) { if (isEnabled(Level.ERROR)) { doLogf(Level.ERROR, FQCN, format, new Object[] { param1 }, null); } } /** * Issue a formatted log message with a level of ERROR. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter */ public void errorf(String format, Object param1, Object param2) { if (isEnabled(Level.ERROR)) { doLogf(Level.ERROR, FQCN, format, new Object[] { param1, param2 }, null); } } /** * Issue a formatted log message with a level of ERROR. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void errorf(String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.ERROR)) { doLogf(Level.ERROR, FQCN, format, new Object[] { param1, param2, param3 }, null); } } /** * Issue a formatted log message with a level of ERROR. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param params the parameters */ public void errorf(Throwable t, String format, Object... params) { doLogf(Level.ERROR, FQCN, format, params, t); } /** * Issue a formatted log message with a level of ERROR. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the sole parameter */ public void errorf(Throwable t, String format, Object param1) { if (isEnabled(Level.ERROR)) { doLogf(Level.ERROR, FQCN, format, new Object[] { param1 }, t); } } /** * Issue a formatted log message with a level of ERROR. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter */ public void errorf(Throwable t, String format, Object param1, Object param2) { if (isEnabled(Level.ERROR)) { doLogf(Level.ERROR, FQCN, format, new Object[] { param1, param2 }, t); } } /** * Issue a formatted log message with a level of ERROR. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void errorf(Throwable t, String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.ERROR)) { doLogf(Level.ERROR, FQCN, format, new Object[] { param1, param2, param3 }, t); } } /** * Issue a log message with a level of FATAL. * * @param message the message */ public void fatal(Object message) { doLog(Level.FATAL, FQCN, message, null, null); } /** * Issue a log message and throwable with a level of FATAL. * * @param message the message * @param t the throwable */ public void fatal(Object message, Throwable t) { doLog(Level.FATAL, FQCN, message, null, t); } /** * Issue a log message and throwable with a level of FATAL and a specific logger class name. * * @param loggerFqcn the logger class name * @param message the message * @param t the throwable */ public void fatal(String loggerFqcn, Object message, Throwable t) { doLog(Level.FATAL, loggerFqcn, message, null, t); } /** * Issue a log message with parameters with a level of FATAL. * * @param message the message * @param params the message parameters * @deprecated To log a message with parameters, using {@link #fatalv(String, Object...)} is recommended. */ @Deprecated public void fatal(Object message, Object[] params) { doLog(Level.FATAL, FQCN, message, params, null); } /** * Issue a log message with parameters and a throwable with a level of FATAL. * * @param message the message * @param params the message parameters * @param t the throwable * @deprecated To log a message with parameters, using {@link #fatalv(Throwable, String, Object...)} is recommended. */ @Deprecated public void fatal(Object message, Object[] params, Throwable t) { doLog(Level.FATAL, FQCN, message, params, t); } /** * Issue a log message with parameters and a throwable with a level of FATAL. * * @param loggerFqcn the logger class name * @param message the message * @param params the message parameters * @param t the throwable */ public void fatal(String loggerFqcn, Object message, Object[] params, Throwable t) { doLog(Level.FATAL, loggerFqcn, message, params, t); } /** * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param params the parameters */ public void fatalv(String format, Object... params) { doLog(Level.FATAL, FQCN, format, params, null); } /** * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the sole parameter */ public void fatalv(String format, Object param1) { if (isEnabled(Level.FATAL)) { doLog(Level.FATAL, FQCN, format, new Object[] { param1 }, null); } } /** * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ public void fatalv(String format, Object param1, Object param2) { if (isEnabled(Level.FATAL)) { doLog(Level.FATAL, FQCN, format, new Object[] { param1, param2 }, null); } } /** * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. * * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void fatalv(String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.FATAL)) { doLog(Level.FATAL, FQCN, format, new Object[] { param1, param2, param3 }, null); } } /** * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param params the parameters */ public void fatalv(Throwable t, String format, Object... params) { doLog(Level.FATAL, FQCN, format, params, t); } /** * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the sole parameter */ public void fatalv(Throwable t, String format, Object param1) { if (isEnabled(Level.FATAL)) { doLog(Level.FATAL, FQCN, format, new Object[] { param1 }, t); } } /** * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ public void fatalv(Throwable t, String format, Object param1, Object param2) { if (isEnabled(Level.FATAL)) { doLog(Level.FATAL, FQCN, format, new Object[] { param1, param2 }, t); } } /** * Issue a log message with a level of FATAL using {@link java.text.MessageFormat}-style formatting. * * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void fatalv(Throwable t, String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.FATAL)) { doLog(Level.FATAL, FQCN, format, new Object[] { param1, param2, param3 }, t); } } /** * Issue a formatted log message with a level of FATAL. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param params the parameters */ public void fatalf(String format, Object... params) { doLogf(Level.FATAL, FQCN, format, params, null); } /** * Issue a formatted log message with a level of FATAL. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the sole parameter */ public void fatalf(String format, Object param1) { if (isEnabled(Level.FATAL)) { doLogf(Level.FATAL, FQCN, format, new Object[] { param1 }, null); } } /** * Issue a formatted log message with a level of FATAL. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter */ public void fatalf(String format, Object param1, Object param2) { if (isEnabled(Level.FATAL)) { doLogf(Level.FATAL, FQCN, format, new Object[] { param1, param2 }, null); } } /** * Issue a formatted log message with a level of FATAL. * * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void fatalf(String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.FATAL)) { doLogf(Level.FATAL, FQCN, format, new Object[] { param1, param2, param3 }, null); } } /** * Issue a formatted log message with a level of FATAL. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param params the parameters */ public void fatalf(Throwable t, String format, Object... params) { doLogf(Level.FATAL, FQCN, format, params, t); } /** * Issue a formatted log message with a level of FATAL. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the sole parameter */ public void fatalf(Throwable t, String format, Object param1) { if (isEnabled(Level.FATAL)) { doLogf(Level.FATAL, FQCN, format, new Object[] { param1 }, t); } } /** * Issue a formatted log message with a level of FATAL. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter */ public void fatalf(Throwable t, String format, Object param1, Object param2) { if (isEnabled(Level.FATAL)) { doLogf(Level.FATAL, FQCN, format, new Object[] { param1, param2 }, t); } } /** * Issue a formatted log message with a level of FATAL. * * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void fatalf(Throwable t, String format, Object param1, Object param2, Object param3) { if (isEnabled(Level.FATAL)) { doLogf(Level.FATAL, FQCN, format, new Object[] { param1, param2, param3 }, t); } } /** * Log a message at the given level. * * @param level the level * @param message the message */ public void log(Level level, Object message) { doLog(level, FQCN, message, null, null); } /** * Issue a log message and throwable at the given log level. * * @param level the level * @param message the message * @param t the throwable */ public void log(Level level, Object message, Throwable t) { doLog(level, FQCN, message, null, t); } /** * Issue a log message and throwable at the given log level and a specific logger class name. * * @param level the level * @param loggerFqcn the logger class name * @param message the message * @param t the throwable */ public void log(Level level, String loggerFqcn, Object message, Throwable t) { doLog(level, loggerFqcn, message, null, t); } /** * Issue a log message with parameters at the given log level. * * @param level the level * @param message the message * @param params the message parameters * @deprecated To log a message with parameters, using {@link #logv(Level, String, Object...)} is recommended. */ @Deprecated public void log(Level level, Object message, Object[] params) { doLog(level, FQCN, message, params, null); } /** * Issue a log message with parameters and a throwable at the given log level. * * @param level the level * @param message the message * @param params the message parameters * @param t the throwable * @deprecated To log a message with parameters, using {@link #logv(Level, Throwable, String, Object...)} is recommended. */ @Deprecated public void log(Level level, Object message, Object[] params, Throwable t) { doLog(level, FQCN, message, params, t); } /** * Issue a log message with parameters and a throwable at the given log level. * * @param loggerFqcn the logger class name * @param level the level * @param message the message * @param params the message parameters * @param t the throwable */ public void log(String loggerFqcn, Level level, Object message, Object[] params, Throwable t) { doLog(level, loggerFqcn, message, params, t); } /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param level the level * @param format the message format string * @param params the parameters */ public void logv(Level level, String format, Object... params) { doLog(level, FQCN, format, params, null); } /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param level the level * @param format the message format string * @param param1 the sole parameter */ public void logv(Level level, String format, Object param1) { if (isEnabled(level)) { doLog(level, FQCN, format, new Object[] { param1 }, null); } } /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param level the level * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ public void logv(Level level, String format, Object param1, Object param2) { if (isEnabled(level)) { doLog(level, FQCN, format, new Object[] { param1, param2 }, null); } } /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param level the level * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void logv(Level level, String format, Object param1, Object param2, Object param3) { if (isEnabled(level)) { doLog(level, FQCN, format, new Object[] { param1, param2, param3 }, null); } } /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param level the level * @param t the throwable * @param format the message format string * @param params the parameters */ public void logv(Level level, Throwable t, String format, Object... params) { doLog(level, FQCN, format, params, t); } /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param level the level * @param t the throwable * @param format the message format string * @param param1 the sole parameter */ public void logv(Level level, Throwable t, String format, Object param1) { if (isEnabled(level)) { doLog(level, FQCN, format, new Object[] { param1 }, t); } } /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param level the level * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ public void logv(Level level, Throwable t, String format, Object param1, Object param2) { if (isEnabled(level)) { doLog(level, FQCN, format, new Object[] { param1, param2 }, t); } } /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param level the level * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void logv(Level level, Throwable t, String format, Object param1, Object param2, Object param3) { if (isEnabled(level)) { doLog(level, FQCN, format, new Object[] { param1, param2, param3 }, t); } } /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param loggerFqcn the logger class name * @param level the level * @param t the throwable * @param format the message format string * @param params the parameters */ public void logv(String loggerFqcn, Level level, Throwable t, String format, Object... params) { doLog(level, loggerFqcn, format, params, t); } /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param loggerFqcn the logger class name * @param level the level * @param t the throwable * @param format the message format string * @param param1 the sole parameter */ public void logv(String loggerFqcn, Level level, Throwable t, String format, Object param1) { if (isEnabled(level)) { doLog(level, loggerFqcn, format, new Object[] { param1 }, t); } } /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param loggerFqcn the logger class name * @param level the level * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter */ public void logv(String loggerFqcn, Level level, Throwable t, String format, Object param1, Object param2) { if (isEnabled(level)) { doLog(level, loggerFqcn, format, new Object[] { param1, param2 }, t); } } /** * Issue a log message at the given log level using {@link java.text.MessageFormat}-style formatting. * * @param loggerFqcn the logger class name * @param level the level * @param t the throwable * @param format the message format string * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void logv(String loggerFqcn, Level level, Throwable t, String format, Object param1, Object param2, Object param3) { if (isEnabled(level)) { doLog(level, loggerFqcn, format, new Object[] { param1, param2, param3 }, t); } } /** * Issue a formatted log message at the given log level. * * @param level the level * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param params the parameters */ public void logf(Level level, String format, Object... params) { doLogf(level, FQCN, format, params, null); } /** * Issue a formatted log message at the given log level. * * @param level the level * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the sole parameter */ public void logf(Level level, String format, Object param1) { if (isEnabled(level)) { doLogf(level, FQCN, format, new Object[] { param1 }, null); } } /** * Issue a formatted log message at the given log level. * * @param level the level * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter */ public void logf(Level level, String format, Object param1, Object param2) { if (isEnabled(level)) { doLogf(level, FQCN, format, new Object[] { param1, param2 }, null); } } /** * Issue a formatted log message at the given log level. * * @param level the level * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void logf(Level level, String format, Object param1, Object param2, Object param3) { if (isEnabled(level)) { doLogf(level, FQCN, format, new Object[] { param1, param2, param3 }, null); } } /** * Issue a formatted log message at the given log level. * * @param level the level * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param params the parameters */ public void logf(Level level, Throwable t, String format, Object... params) { doLogf(level, FQCN, format, params, t); } /** * Issue a formatted log message at the given log level. * * @param level the level * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the sole parameter */ public void logf(Level level, Throwable t, String format, Object param1) { if (isEnabled(level)) { doLogf(level, FQCN, format, new Object[] { param1 }, t); } } /** * Issue a formatted log message at the given log level. * * @param level the level * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter */ public void logf(Level level, Throwable t, String format, Object param1, Object param2) { if (isEnabled(level)) { doLogf(level, FQCN, format, new Object[] { param1, param2 }, t); } } /** * Issue a formatted log message at the given log level. * * @param level the level * @param t the throwable * @param format the format string, as per {@link String#format(String, Object...)} * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void logf(Level level, Throwable t, String format, Object param1, Object param2, Object param3) { if (isEnabled(level)) { doLogf(level, FQCN, format, new Object[] { param1, param2, param3 }, t); } } /** * Log a message at the given level. * * @param loggerFqcn the logger class name * @param level the level * @param t the throwable cause * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the sole parameter */ public void logf(String loggerFqcn, Level level, Throwable t, String format, Object param1) { if (isEnabled(level)) { doLogf(level, loggerFqcn, format, new Object[] { param1 }, t); } } /** * Log a message at the given level. * * @param loggerFqcn the logger class name * @param level the level * @param t the throwable cause * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter */ public void logf(String loggerFqcn, Level level, Throwable t, String format, Object param1, Object param2) { if (isEnabled(level)) { doLogf(level, loggerFqcn, format, new Object[] { param1, param2 }, t); } } /** * Log a message at the given level. * * @param loggerFqcn the logger class name * @param level the level * @param t the throwable cause * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param param1 the first parameter * @param param2 the second parameter * @param param3 the third parameter */ public void logf(String loggerFqcn, Level level, Throwable t, String format, Object param1, Object param2, Object param3) { if (isEnabled(level)) { doLogf(level, loggerFqcn, format, new Object[] { param1, param2, param3 }, t); } } /** * Log a message at the given level. * * @param loggerFqcn the logger class name * @param level the level * @param t the throwable cause * @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor * @param params the message parameters */ public void logf(String loggerFqcn, Level level, Throwable t, String format, Object... params) { doLogf(level, loggerFqcn, format, params, t); } /** * Read resolver; replaces deserialized instance with a canonical instance. * * @return the canonical logger instance */ protected final Object writeReplace() { return new SerializedLogger(name); } /** * Get a Logger instance given the logger name. * * @param name the logger name * * @return the logger */ public static Logger getLogger(String name) { return LoggerProviders.PROVIDER.getLogger(name); } /** * Get a Logger instance given the logger name with the given suffix. *

*

This will include a logger separator between logger name and suffix. * * @param name the logger name * @param suffix a suffix to append to the logger name * * @return the logger */ public static Logger getLogger(String name, String suffix) { return getLogger(name == null || name.length() == 0 ? suffix : name + "." + suffix); } /** * Get a Logger instance given the name of a class. This simply calls create(clazz.getName()). * * @param clazz the Class whose name will be used as the logger name * * @return the logger */ public static Logger getLogger(Class clazz) { return getLogger(clazz.getName()); } /** * Get a Logger instance given the name of a class with the given suffix. *

*

This will include a logger separator between logger name and suffix * * @param clazz the Class whose name will be used as the logger name * @param suffix a suffix to append to the logger name * * @return the logger */ public static Logger getLogger(Class clazz, String suffix) { return getLogger(clazz.getName(), suffix); } /** * Get a typed logger which implements the given interface. The current default locale will be used for the new logger. * * @param type the interface to implement * @param category the logger category * @param the logger type * @return the typed logger */ public static T getMessageLogger(Class type, String category) { return getMessageLogger(type, category, LoggingLocale.getLocale()); } /** * Get a typed logger which implements the given interface. The given locale will be used for the new logger. * * @param type the interface to implement * @param category the logger category * @param locale the locale for the new logger * @param the logger type * @return the typed logger */ public static T getMessageLogger(final Class type, final String category, final Locale locale) { if (System.getSecurityManager() == null) return doGetMessageLogger(type, category, locale); return doPrivileged(new PrivilegedAction() { public T run() { return doGetMessageLogger(type, category, locale); } }); } private static T doGetMessageLogger(final Class type, final String category, final Locale locale) { String language = locale.getLanguage(); String country = locale.getCountry(); String variant = locale.getVariant(); Class loggerClass = null; final ClassLoader classLoader = type.getClassLoader(); final String typeName = type.getName(); if (variant != null && variant.length() > 0) try { loggerClass = Class.forName(join(typeName, "$logger", language, country, variant), true, classLoader).asSubclass(type); } catch (ClassNotFoundException e) { // ignore } if (loggerClass == null && country != null && country.length() > 0) try { loggerClass = Class.forName(join(typeName, "$logger", language, country, null), true, classLoader).asSubclass(type); } catch (ClassNotFoundException e) { // ignore } if (loggerClass == null && language != null && language.length() > 0) try { loggerClass = Class.forName(join(typeName, "$logger", language, null, null), true, classLoader).asSubclass(type); } catch (ClassNotFoundException e) { // ignore } if (loggerClass == null) try { loggerClass = Class.forName(join(typeName, "$logger", null, null, null), true, classLoader).asSubclass(type); } catch (ClassNotFoundException e) { throw new IllegalArgumentException("Invalid logger " + type + " (implementation not found in " + classLoader + ")"); } final Constructor constructor; try { constructor = loggerClass.getConstructor(Logger.class); } catch (NoSuchMethodException e) { throw new IllegalArgumentException("Logger implementation " + loggerClass + " has no matching constructor"); } try { return constructor.newInstance(Logger.getLogger(category)); } catch (InstantiationException e) { throw new IllegalArgumentException("Logger implementation " + loggerClass + " could not be instantiated", e); } catch (IllegalAccessException e) { throw new IllegalArgumentException("Logger implementation " + loggerClass + " could not be instantiated", e); } catch (InvocationTargetException e) { throw new IllegalArgumentException("Logger implementation " + loggerClass + " could not be instantiated", e.getCause()); } } private static String join(String interfaceName, String a, String b, String c, String d) { final StringBuilder build = new StringBuilder(); build.append(interfaceName).append('_').append(a); if (b != null && b.length() > 0) { build.append('_'); build.append(b); } if (c != null && c.length() > 0) { build.append('_'); build.append(c); } if (d != null && d.length() > 0) { build.append('_'); build.append(d); } return build.toString(); } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/LoggerProvider.java000066400000000000000000000066001416737514500271220ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.util.Collections; import java.util.Map; /** * A contract for the log provider implementation. */ public interface LoggerProvider { /** * Returns a logger which is backed by a logger from the log provider. * *

* Note: this should never be {@code null} *

* * @param name the name of the logger * * @return a logger for the log provider logger. */ Logger getLogger(String name); /** * Removes all entries from the message diagnostics context. */ void clearMdc(); /** * Puts the value onto the message diagnostics context. * * @param key the key for the value * @param value the value * * @return the previous value set or {@code null} if no value was set */ Object putMdc(String key, Object value); /** * Returns the value for the key on the message diagnostics context or {@code null} if no value was found. * * @param key the key to lookup the value for * * @return the value or {@code null} if not found */ Object getMdc(String key); /** * Removes the value from the message diagnostics context. * * @param key the key of the value to remove */ void removeMdc(String key); /** * Returns the map from the context. * *

* Note that in most implementations this is an expensive operation and should be used sparingly. *

* * @return the map from the context or an {@linkplain Collections#emptyMap() empty map} if the context is {@code * null} */ Map getMdcMap(); /** * Clears the nested diagnostics context. */ void clearNdc(); /** * Retrieves the current values set for the nested diagnostics context. * * @return the current value set or {@code null} if no value was set */ String getNdc(); /** * The current depth of the nested diagnostics context. * * @return the current depth of the stack */ int getNdcDepth(); /** * Pops top value from the stack and returns it. * * @return the top value from the stack or an empty string if no value was set */ String popNdc(); /** * Peeks at the top value from the stack and returns it. * * @return the value or an empty string */ String peekNdc(); /** * Pushes a value to the nested diagnostics context stack. * * @param message the message to push */ void pushNdc(String message); /** * Sets maximum depth of the stack removing any entries below the maximum depth. * * @param maxDepth the maximum depth to set */ void setNdcMaxDepth(int maxDepth); } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/LoggerProviders.java000066400000000000000000000151701416737514500273070ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2011 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.util.Iterator; import java.util.ServiceConfigurationError; import java.util.ServiceLoader; import java.util.logging.LogManager; final class LoggerProviders { static final String LOGGING_PROVIDER_KEY = "org.jboss.logging.provider"; static final LoggerProvider PROVIDER = find(); private static LoggerProvider find() { return findProvider(); } private static LoggerProvider findProvider() { // Since the impl classes refer to the back-end frameworks directly, if this classloader can't find the target // log classes, then it doesn't really matter if they're possibly available from the TCCL because we won't be // able to find it anyway final ClassLoader cl = LoggerProviders.class.getClassLoader(); try { // Check the system property final String loggerProvider = SecurityActions.getSystemProperty(LOGGING_PROVIDER_KEY); if (loggerProvider != null) { if ("jboss".equalsIgnoreCase(loggerProvider)) { return tryJBossLogManager(cl, "system property"); } else if ("jdk".equalsIgnoreCase(loggerProvider)) { return tryJDK("system property"); } else if ("log4j2".equalsIgnoreCase(loggerProvider)) { return tryLog4j2(cl, "system property"); } else if ("log4j".equalsIgnoreCase(loggerProvider)) { return tryLog4j(cl, "system property"); } else if ("slf4j".equalsIgnoreCase(loggerProvider)) { return trySlf4j("system property"); } } } catch (Throwable t) { // nope... } // Next try for a service provider try { final ServiceLoader loader = ServiceLoader.load(LoggerProvider.class, cl); final Iterator iter = loader.iterator(); for (; ; ) try { if (!iter.hasNext()) break; LoggerProvider provider = iter.next(); // Attempt to get a logger, if it fails keep trying logProvider(provider, "service loader"); return provider; } catch (ServiceConfigurationError ignore) { } } catch (Throwable ignore) { // TODO consider printing the stack trace as it should only happen once } // Finally search the class path try { return tryJBossLogManager(cl, null); } catch (Throwable t) { // nope... } try { // MUST try Log4j 2.x BEFORE Log4j 1.x because Log4j 2.x also passes Log4j 1.x test in some circumstances return tryLog4j2(cl, null); } catch (Throwable t) { // nope... } try { return tryLog4j(cl, null); } catch (Throwable t) { // nope... } try { // only use slf4j if Logback is in use Class.forName("ch.qos.logback.classic.Logger", false, cl); return trySlf4j(null); } catch (Throwable t) { // nope... } return tryJDK(null); } private static JDKLoggerProvider tryJDK(final String via) { final JDKLoggerProvider provider = new JDKLoggerProvider(); logProvider(provider, via); return provider; } private static LoggerProvider trySlf4j(final String via) { final LoggerProvider provider = new Slf4jLoggerProvider(); logProvider(provider, via); return provider; } // JBLOGGING-95 - Add support for Log4j 2.x private static LoggerProvider tryLog4j2(final ClassLoader cl, final String via) throws ClassNotFoundException { Class.forName("org.apache.logging.log4j.Logger", true, cl); Class.forName("org.apache.logging.log4j.LogManager", true, cl); Class.forName("org.apache.logging.log4j.spi.AbstractLogger", true, cl); LoggerProvider provider = new Log4j2LoggerProvider(); // if Log4j 2 has a bad implementation that doesn't extend AbstractLogger, we won't know until getting the first logger throws an exception logProvider(provider, via); return provider; } private static LoggerProvider tryLog4j(final ClassLoader cl, final String via) throws ClassNotFoundException { Class.forName("org.apache.log4j.LogManager", true, cl); // JBLOGGING-65 - slf4j can disguise itself as log4j. Test for a class that slf4j doesn't provide. // JBLOGGING-94 - JBoss Logging does not detect org.apache.logging.log4j:log4j-1.2-api:2.0 Class.forName("org.apache.log4j.config.PropertySetter", true, cl); final LoggerProvider provider = new Log4jLoggerProvider(); logProvider(provider, via); return provider; } private static LoggerProvider tryJBossLogManager(final ClassLoader cl, final String via) throws ClassNotFoundException { final Class logManagerClass = LogManager.getLogManager().getClass(); if (logManagerClass == Class.forName("org.jboss.logmanager.LogManager", false, cl) && Class.forName("org.jboss.logmanager.Logger$AttachmentKey", true, cl).getClassLoader() == logManagerClass.getClassLoader()) { final LoggerProvider provider = new JBossLogManagerProvider(); logProvider(provider, via); return provider; } throw new IllegalStateException(); } private static void logProvider(final LoggerProvider provider, final String via) { // Log a debug message indicating which logger we are using final Logger logger = provider.getLogger("org.jboss.logging"); if (via == null) { logger.debugf("Logging Provider: %s", provider.getClass().getName()); } else { logger.debugf("Logging Provider: %s found via %s", provider.getClass().getName(), via); } } private LoggerProviders() { } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/LoggingLocale.java000066400000000000000000000144221416737514500266770ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2017 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.util.Locale; /** * A simple utility to resolve the default locale to use for internationalized loggers and message bundles. * * @author James R. Perkins */ @SuppressWarnings("SameParameterValue") class LoggingLocale { private static final Locale LOCALE = getDefaultLocale(); /** * Attempts to create a {@link Locale} based on the {@code org.jboss.logging.locale} system property. If the value * is not defined the {@linkplain Locale#getDefault() default locale} will be used. *

* The value should be in the BCP 47 format. *

*

* Note: Currently this uses a custom parser to attempt to parse the BCP 47 format. This will be * changed to use the {@code Locale.forLanguageTag()} once a move to JDK 7. Currently only the language, region and * variant are used to construct the locale. *

* * @return the locale created or the default locale */ static Locale getLocale() { return LOCALE; } private static Locale getDefaultLocale() { final String bcp47Tag = SecurityActions.getSystemProperty("org.jboss.logging.locale", ""); if (bcp47Tag.trim().isEmpty()) { return Locale.getDefault(); } // When we upgrade to Java 7 we can use the Locale.forLanguageTag(locale) which will reliably parse the // the value. For now we have to attempt to parse it the best we can. return forLanguageTag(bcp47Tag); } private static Locale forLanguageTag(final String locale) { // First check known locales if ("en-CA".equalsIgnoreCase(locale)) { return Locale.CANADA; } else if ("fr-CA".equalsIgnoreCase(locale)) { return Locale.CANADA_FRENCH; } else if ("zh".equalsIgnoreCase(locale)) { return Locale.CHINESE; } else if ("en".equalsIgnoreCase(locale)) { return Locale.ENGLISH; } else if ("fr-FR".equalsIgnoreCase(locale)) { return Locale.FRANCE; } else if ("fr".equalsIgnoreCase(locale)) { return Locale.FRENCH; } else if ("de".equalsIgnoreCase(locale)) { return Locale.GERMAN; } else if ("de-DE".equalsIgnoreCase(locale)) { return Locale.GERMANY; } else if ("it".equalsIgnoreCase(locale)) { return Locale.ITALIAN; } else if ("it-IT".equalsIgnoreCase(locale)) { return Locale.ITALY; } else if ("ja-JP".equalsIgnoreCase(locale)) { return Locale.JAPAN; } else if ("ja".equalsIgnoreCase(locale)) { return Locale.JAPANESE; } else if ("ko-KR".equalsIgnoreCase(locale)) { return Locale.KOREA; } else if ("ko".equalsIgnoreCase(locale)) { return Locale.KOREAN; } else if ("zh-CN".equalsIgnoreCase(locale)) { return Locale.SIMPLIFIED_CHINESE; } else if ("zh-TW".equalsIgnoreCase(locale)) { return Locale.TRADITIONAL_CHINESE; } else if ("en-UK".equalsIgnoreCase(locale)) { return Locale.UK; } else if ("en-US".equalsIgnoreCase(locale)) { return Locale.US; } // Split the string into parts and attempt final String[] parts = locale.split("-"); final int len = parts.length; int index = 0; int count = 0; final String language = parts[index++]; String region = ""; // country String variant = ""; // The next 3 sections may be extended languages, we're just going to ignore them while (index < len) { if (count++ == 2 || !isAlpha(parts[index], 3, 3)) { break; } index++; } // Check for a script, we'll skip it however a script is not supported until Java 7 if (index != len && isAlpha(parts[index], 4, 4)) { index++; } // Next should be the region, 3 digit is allowed but may not work with Java 6 if (index != len && (isAlpha(parts[index], 2, 2) || isNumeric(parts[index], 3, 3))) { region = parts[index++]; } // Next should be the variant and we will just use the first one found, all other parts will be ignored if (index != len && (isAlphaOrNumeric(parts[index], 5, 8))) { variant = parts[index]; } return new Locale(language, region, variant); } private static boolean isAlpha(final String value, final int minLen, final int maxLen) { final int len = value.length(); if (len < minLen || len > maxLen) { return false; } for (int i = 0; i < len; i++) { if (!Character.isLetter(value.charAt(i))) { return false; } } return true; } private static boolean isNumeric(final String value, final int minLen, final int maxLen) { final int len = value.length(); if (len < minLen || len > maxLen) { return false; } for (int i = 0; i < len; i++) { if (!Character.isDigit(value.charAt(i))) { return false; } } return true; } private static boolean isAlphaOrNumeric(final String value, final int minLen, final int maxLen) { final int len = value.length(); if (len < minLen || len > maxLen) { return false; } for (int i = 0; i < len; i++) { if (!Character.isLetterOrDigit(value.charAt(i))) { return false; } } return true; } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/MDC.java000066400000000000000000000044141416737514500245740ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.util.Collections; import java.util.Map; /** * Mapped diagnostic context. Each log provider implementation may behave different. */ public final class MDC { private MDC() { } /** * Puts the value onto the context. * * @param key the key for the value * @param val the value * * @return the previous value set or {@code null} if no value was set */ public static Object put(String key, Object val) { return LoggerProviders.PROVIDER.putMdc(key, val); } /** * Returns the value for the key or {@code null} if no value was found. * * @param key the key to lookup the value for * * @return the value or {@code null} if not found */ public static Object get(String key) { return LoggerProviders.PROVIDER.getMdc(key); } /** * Removes the value from the context. * * @param key the key of the value to remove */ public static void remove(String key) { LoggerProviders.PROVIDER.removeMdc(key); } /** * Returns the map from the context. * *

* Note that in most implementations this is an expensive operation and should be used sparingly. *

* * @return the map from the context or an {@linkplain Collections#emptyMap() empty map} if the context is {@code * null} */ public static Map getMap() { return LoggerProviders.PROVIDER.getMdcMap(); } /** * Clears the message diagnostics context. */ public static void clear() { LoggerProviders.PROVIDER.clearMdc(); } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/Messages.java000066400000000000000000000110751416737514500257410ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed 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.jboss.logging; import java.lang.reflect.Field; import java.security.PrivilegedAction; import java.util.Locale; import static java.security.AccessController.doPrivileged; /** * A factory class to produce message bundle implementations. * * @author David M. Lloyd */ public final class Messages { private Messages() { } /** * Get a message bundle of the given type. Equivalent to {@link #getBundle(Class, java.util.Locale) getBundle}(type, Locale.getDefault()). * * @param type the bundle type class * @param the bundle type * @return the bundle */ public static T getBundle(Class type) { return getBundle(type, LoggingLocale.getLocale()); } /** * Get a message bundle of the given type. * * @param type the bundle type class * @param locale the message locale to use * @param the bundle type * @return the bundle */ public static T getBundle(final Class type, final Locale locale) { if (System.getSecurityManager() == null) { return doGetBundle(type, locale); } return doPrivileged(new PrivilegedAction() { public T run() { return doGetBundle(type, locale); } }); } private static T doGetBundle(final Class type, final Locale locale) { String language = locale.getLanguage(); String country = locale.getCountry(); String variant = locale.getVariant(); Class bundleClass = null; if (variant != null && variant.length() > 0) try { bundleClass = Class.forName(join(type.getName(), "$bundle", language, country, variant), true, type.getClassLoader()).asSubclass(type); } catch (ClassNotFoundException e) { // ignore } if (bundleClass == null && country != null && country.length() > 0) try { bundleClass = Class.forName(join(type.getName(), "$bundle", language, country, null), true, type.getClassLoader()).asSubclass(type); } catch (ClassNotFoundException e) { // ignore } if (bundleClass == null && language != null && language.length() > 0) try { bundleClass = Class.forName(join(type.getName(), "$bundle", language, null, null), true, type.getClassLoader()).asSubclass(type); } catch (ClassNotFoundException e) { // ignore } if (bundleClass == null) try { bundleClass = Class.forName(join(type.getName(), "$bundle", null, null, null), true, type.getClassLoader()).asSubclass(type); } catch (ClassNotFoundException e) { throw new IllegalArgumentException("Invalid bundle " + type + " (implementation not found)"); } final Field field; try { field = bundleClass.getField("INSTANCE"); } catch (NoSuchFieldException e) { throw new IllegalArgumentException("Bundle implementation " + bundleClass + " has no instance field"); } try { return type.cast(field.get(null)); } catch (IllegalAccessException e) { throw new IllegalArgumentException("Bundle implementation " + bundleClass + " could not be instantiated", e); } } private static String join(String interfaceName, String a, String b, String c, String d) { final StringBuilder build = new StringBuilder(); build.append(interfaceName).append('_').append(a); if (b != null && b.length() > 0) { build.append('_'); build.append(b); } if (c != null && c.length() > 0) { build.append('_'); build.append(c); } if (d != null && d.length() > 0) { build.append('_'); build.append(d); } return build.toString(); } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/NDC.java000066400000000000000000000044401416737514500245740ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc. * * Licensed 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.jboss.logging; public final class NDC { private NDC() { } /** * Clears the nested diagnostics context. */ public static void clear() { LoggerProviders.PROVIDER.clearNdc(); } /** * Retrieves the current values set for the nested diagnostics context. * * @return the current value set or {@code null} if no value was set */ public static String get() { return LoggerProviders.PROVIDER.getNdc(); } /** * The current depth of the nested diagnostics context. * * @return the current depth of the stack */ public static int getDepth() { return LoggerProviders.PROVIDER.getNdcDepth(); } /** * Pops top value from the stack and returns it. * * @return the top value from the stack or an empty string if no value was set */ public static String pop() { return LoggerProviders.PROVIDER.popNdc(); } /** * Peeks at the top value from the stack and returns it. * * @return the value or an empty string */ public static String peek() { return LoggerProviders.PROVIDER.peekNdc(); } /** * Pushes a value to the nested diagnostics context stack. * * @param message the message to push */ public static void push(String message) { LoggerProviders.PROVIDER.pushNdc(message); } /** * Sets maximum depth of the stack removing any entries below the maximum depth. * * @param maxDepth the maximum depth to set */ public static void setMaxDepth(int maxDepth) { LoggerProviders.PROVIDER.setNdcMaxDepth(maxDepth); } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/ParameterConverter.java000066400000000000000000000030201416737514500277710ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed 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.jboss.logging; import java.util.Locale; /** * A converter for a specific parameter type. * * @author David M. Lloyd * @param the input type * @deprecated this is not currently used anywhere and no replacement will be created */ @Deprecated public interface ParameterConverter { /** * Convert the parameter to its string or string-equivalent representation. The returned value will be passed in * as a parameter to either a {@link java.text.MessageFormat} or {@link java.util.Formatter} instance, depending * on the setting of {@code org.jboss.logging.annotation.Message.format}. * * @param locale the locale * @param parameter the parameter * @return the converted value */ Object convert(Locale locale, I parameter); } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/SecurityActions.java000066400000000000000000000032101416737514500273120ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2019 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.security.AccessController; import java.security.PrivilegedAction; /** * @author James R. Perkins */ @SuppressWarnings("SameParameterValue") class SecurityActions { static String getSystemProperty(final String key) { if (System.getSecurityManager() == null) { return System.getProperty(key); } return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return System.getProperty(key); } }); } static String getSystemProperty(final String key, final String dft) { if (System.getSecurityManager() == null) { return System.getProperty(key, dft); } return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return System.getProperty(key, dft); } }); } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/SerializedLogger.java000066400000000000000000000017751416737514500274330ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.io.Serializable; final class SerializedLogger implements Serializable { private static final long serialVersionUID = 508779982439435831L; private final String name; SerializedLogger(final String name) { this.name = name; } protected Object readResolve() { return Logger.getLogger(name); } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/Slf4jLocationAwareLogger.java000066400000000000000000000110241416737514500307570ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.UndeclaredThrowableException; import java.text.MessageFormat; import org.slf4j.spi.LocationAwareLogger; final class Slf4jLocationAwareLogger extends Logger { private static final long serialVersionUID = 8685757928087758380L; private static final Object[] EMPTY = new Object[0]; private static final boolean POST_1_6; private static final Method LOG_METHOD; static { Method[] methods = LocationAwareLogger.class.getDeclaredMethods(); Method logMethod = null; boolean post16 = false; for (Method method : methods) { if (method.getName().equals("log")) { logMethod = method; Class[] parameterTypes = method.getParameterTypes(); post16 = parameterTypes.length == 6; } } if (logMethod == null) { throw new NoSuchMethodError("Cannot find LocationAwareLogger.log() method"); } POST_1_6 = post16; LOG_METHOD = logMethod; } private final LocationAwareLogger logger; Slf4jLocationAwareLogger(final String name, final LocationAwareLogger logger) { super(name); this.logger = logger; } public boolean isEnabled(final Level level) { if (level != null) switch (level) { case FATAL: return logger.isErrorEnabled(); case ERROR: return logger.isErrorEnabled(); case WARN: return logger.isWarnEnabled(); case INFO: return logger.isInfoEnabled(); case DEBUG: return logger.isDebugEnabled(); case TRACE: return logger.isTraceEnabled(); } return true; } protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) { if (isEnabled(level)) { final String text = parameters == null || parameters.length == 0 ? String.valueOf(message) : MessageFormat.format(String.valueOf(message), parameters); doLog(logger, loggerClassName, translate(level), text, thrown); } } protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) { if (isEnabled(level)) { final String text = parameters == null ? String.format(format) : String.format(format, parameters); doLog(logger, loggerClassName, translate(level), text, thrown); } } private static void doLog(LocationAwareLogger logger, String className, int level, String text, Throwable thrown) { try { if (POST_1_6) { LOG_METHOD.invoke(logger, null, className, Integer.valueOf(level), text, EMPTY, thrown); } else { LOG_METHOD.invoke(logger, null, className, Integer.valueOf(level), text, thrown); } } catch (InvocationTargetException e) { try { throw e.getCause(); } catch (RuntimeException ex) { throw ex; } catch (Error er) { throw er; } catch (Throwable throwable) { throw new UndeclaredThrowableException(throwable); } } catch (IllegalAccessException e) { throw new IllegalAccessError(e.getMessage()); } } private static int translate(Level level) { if (level != null) switch (level) { case FATAL: case ERROR: return LocationAwareLogger.ERROR_INT; case WARN: return LocationAwareLogger.WARN_INT; case INFO: return LocationAwareLogger.INFO_INT; case DEBUG: return LocationAwareLogger.DEBUG_INT; case TRACE: return LocationAwareLogger.TRACE_INT; } return LocationAwareLogger.TRACE_INT; } }jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/Slf4jLogger.java000066400000000000000000000064171416737514500263200ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.text.MessageFormat; final class Slf4jLogger extends Logger { private static final long serialVersionUID = 8685757928087758380L; private final org.slf4j.Logger logger; Slf4jLogger(final String name, final org.slf4j.Logger logger) { super(name); this.logger = logger; } public boolean isEnabled(final Level level) { if (level == Level.TRACE) { return logger.isTraceEnabled(); } else if (level == Level.DEBUG) { return logger.isDebugEnabled(); } return infoOrHigherEnabled(level); } private boolean infoOrHigherEnabled(final Level level) { if (level == Level.INFO) { return logger.isInfoEnabled(); } else if (level == Level.WARN) { return logger.isWarnEnabled(); } else if (level == Level.ERROR || level == Level.FATAL) { return logger.isErrorEnabled(); } return true; } protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) { if (isEnabled(level)) try { final String text = parameters == null || parameters.length == 0 ? String.valueOf(message) : MessageFormat.format(String.valueOf(message), parameters); if (level == Level.INFO) { logger.info(text, thrown); } else if (level == Level.WARN) { logger.warn(text, thrown); } else if (level == Level.ERROR || level == Level.FATAL) { logger.error(text, thrown); } else if (level == Level.DEBUG) { logger.debug(text, thrown); } else if (level == Level.TRACE) { logger.debug(text, thrown); } } catch (Throwable ignored) {} } protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) { if (isEnabled(level)) try { final String text = parameters == null ? String.format(format) : String.format(format, parameters); if (level == Level.INFO) { logger.info(text, thrown); } else if (level == Level.WARN) { logger.warn(text, thrown); } else if (level == Level.ERROR || level == Level.FATAL) { logger.error(text, thrown); } else if (level == Level.DEBUG) { logger.debug(text, thrown); } else if (level == Level.TRACE) { logger.debug(text, thrown); } } catch (Throwable ignored) {} } } jboss-logging-3.4.3.Final/src/main/java/org/jboss/logging/Slf4jLoggerProvider.java000066400000000000000000000036771416737514500300400ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2010 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; import org.slf4j.LoggerFactory; import org.slf4j.MDC; import org.slf4j.spi.LocationAwareLogger; final class Slf4jLoggerProvider extends AbstractLoggerProvider implements LoggerProvider { public Logger getLogger(final String name) { org.slf4j.Logger l = LoggerFactory.getLogger(name); if (l instanceof LocationAwareLogger) { return new Slf4jLocationAwareLogger(name, (LocationAwareLogger) l); } return new Slf4jLogger(name, l); } public void clearMdc() { MDC.clear(); } public Object putMdc(final String key, final Object value) { try { return MDC.get(key); } finally { if (value == null) { MDC.remove(key); } else { MDC.put(key, String.valueOf(value)); } } } public Object getMdc(final String key) { return MDC.get(key); } public void removeMdc(final String key) { MDC.remove(key); } @SuppressWarnings("unchecked") public Map getMdcMap() { final Map copy = MDC.getCopyOfContextMap(); return copy == null ? Collections.emptyMap() : new LinkedHashMap<>(copy); } } jboss-logging-3.4.3.Final/src/main/resources/000077500000000000000000000000001416737514500210575ustar00rootroot00000000000000jboss-logging-3.4.3.Final/src/main/resources/META-INF/000077500000000000000000000000001416737514500222175ustar00rootroot00000000000000jboss-logging-3.4.3.Final/src/main/resources/META-INF/LICENSE.txt000066400000000000000000000261361416737514500240520ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed 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. jboss-logging-3.4.3.Final/src/test/000077500000000000000000000000001416737514500171005ustar00rootroot00000000000000jboss-logging-3.4.3.Final/src/test/java/000077500000000000000000000000001416737514500200215ustar00rootroot00000000000000jboss-logging-3.4.3.Final/src/test/java/org/000077500000000000000000000000001416737514500206105ustar00rootroot00000000000000jboss-logging-3.4.3.Final/src/test/java/org/jboss/000077500000000000000000000000001416737514500217305ustar00rootroot00000000000000jboss-logging-3.4.3.Final/src/test/java/org/jboss/logging/000077500000000000000000000000001416737514500233565ustar00rootroot00000000000000jboss-logging-3.4.3.Final/src/test/java/org/jboss/logging/AbstractClassPathTestCase.java000066400000000000000000000021171416737514500312240ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2020 Red Hat, Inc. * * Licensed 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.jboss.logging; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; /** * @author James R. Perkins */ abstract class AbstractClassPathTestCase { @Test public void testLogger() { final Logger logger = Logger.getLogger(getClass()); Assertions.assertEquals(getLoggerClass(), logger.getClass()); } abstract Class getLoggerClass(); } jboss-logging-3.4.3.Final/src/test/java/org/jboss/logging/AbstractLoggerTestCase.java000066400000000000000000000050271416737514500305640ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2020 Red Hat, Inc. * * Licensed 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.jboss.logging; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; /** * @author James R. Perkins */ abstract class AbstractLoggerTestCase { @AfterAll public static void clearProviderProperty() { System.clearProperty("org.jboss.logging.provider"); } @AfterEach public void clearDiagnostics() { MDC.clear(); NDC.clear(); } @Test public void testLogger() { Assertions.assertEquals(getLoggerClass(), getLogger().getClass()); } @Test public void testLog() { for (Logger.Level level : Logger.Level.values()) { testLog(level); } } @Test public void testTrace() { getLogger().trace("Test log level TRACE"); testLog("Test log level TRACE", Logger.Level.TRACE); } @Test public void testDebug() { getLogger().debug("Test log level DEBUG"); testLog("Test log level DEBUG", Logger.Level.DEBUG); } @Test public void testInfo() { getLogger().info("Test log level INFO"); testLog("Test log level INFO", Logger.Level.INFO); } @Test public void testWarn() { getLogger().warn("Test log level WARN"); testLog("Test log level WARN", Logger.Level.WARN); } @Test public void testError() { getLogger().error("Test log level ERROR"); testLog("Test log level ERROR", Logger.Level.ERROR); } @Test public void testFatal() { getLogger().fatal("Test log level FATAL"); testLog("Test log level FATAL", Logger.Level.FATAL); } abstract void testLog(Logger.Level level); abstract void testLog(String msg, Logger.Level level); abstract Logger getLogger(); abstract Class getLoggerClass(); } jboss-logging-3.4.3.Final/src/test/java/org/jboss/logging/CustomProviderTestCase.java000066400000000000000000000037451416737514500306530ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2020 Red Hat, Inc. * * Licensed 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.jboss.logging; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; /** * @author James R. Perkins */ public class CustomProviderTestCase { @Test public void testLogger() { final Logger logger = Logger.getLogger(CustomProviderTestCase.class); Assertions.assertEquals(TestLogger.class, logger.getClass()); } public static class TestProvider extends AbstractMdcLoggerProvider implements LoggerProvider { @Override public Logger getLogger(final String name) { return new TestLogger(name); } } static class TestLogger extends Logger { /** * Construct a new instance. * * @param name the logger category name */ protected TestLogger(final String name) { super(name); } @Override protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) { } @Override protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) { } @Override public boolean isEnabled(final Level level) { return true; } } } jboss-logging-3.4.3.Final/src/test/java/org/jboss/logging/JBossLogManagerClassPathTestCase.java000066400000000000000000000016571416737514500324460ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2020 Red Hat, Inc. * * Licensed 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.jboss.logging; /** * @author James R. Perkins */ public class JBossLogManagerClassPathTestCase extends AbstractClassPathTestCase { @Override Class getLoggerClass() { return JBossLogManagerLogger.class; } } jboss-logging-3.4.3.Final/src/test/java/org/jboss/logging/JBossLogManagerProviderTestCase.java000066400000000000000000000123521416737514500323500ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2020 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.LogRecord; import org.jboss.logmanager.LogContext; import org.jboss.logmanager.LogContextSelector; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; /** * @author James R. Perkins */ public class JBossLogManagerProviderTestCase extends AbstractLoggerTestCase { private static final LogContextSelector DEFAULT_SELECTOR = LogContext.getLogContextSelector(); private static final AtomicBoolean SET_LOG_MANAGER = new AtomicBoolean(true); private LogContext logContext; private TestHandler handler; private Logger logger; @BeforeAll public static void setup() { SET_LOG_MANAGER.set(System.getProperty("java.util.logging.manager") == null); if (SET_LOG_MANAGER.get()) { System.setProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager"); } System.setProperty("org.jboss.logging.provider", "jboss"); } @AfterAll public static void tearDown() { if (SET_LOG_MANAGER.get()) { System.clearProperty("java.util.logging.manager"); } } @BeforeEach public void setupLogContext() { logContext = LogContext.create(); LogContext.setLogContextSelector(() -> logContext); logger = Logger.getLogger(getClass()); handler = createHandler(logContext, logger.getName()); } @AfterEach public void closeLogContext() throws Exception { logContext.close(); LogContext.setLogContextSelector(DEFAULT_SELECTOR); } @Test public void testMdc() { MDC.put("test.key", "value"); Assertions.assertEquals("value", MDC.get("test.key")); Assertions.assertEquals("value", org.jboss.logmanager.MDC.get("test.key")); } @Test public void testNdc() { NDC.push("value1"); NDC.push("value2"); final String expectedValue = "value1.value2"; Assertions.assertEquals(expectedValue, NDC.peek()); Assertions.assertEquals(expectedValue, NDC.get()); Assertions.assertEquals(2, NDC.getDepth()); // Test the log manager values Assertions.assertEquals(expectedValue, org.jboss.logmanager.NDC.get()); Assertions.assertEquals(2, org.jboss.logmanager.NDC.getDepth()); // Pop the stack Assertions.assertEquals("value2", NDC.pop()); Assertions.assertEquals(1, NDC.getDepth()); Assertions.assertEquals("value1", NDC.get()); Assertions.assertEquals("value1", org.jboss.logmanager.NDC.get()); Assertions.assertEquals(1, org.jboss.logmanager.NDC.getDepth()); } @Override void testLog(final Logger.Level level) { final String msg = String.format("Test log message at %s", level); logger.log(level, msg); Assertions.assertTrue(logger.isEnabled(level), String.format("Logger not enabled for level %s", level)); testLog(msg, level); } @Override void testLog(final String msg, final Logger.Level level) { final LogRecord logRecord = handler.queue.poll(); Assertions.assertNotNull(logRecord, String.format("No record found for %s", level)); Assertions.assertEquals(level.name(), logRecord.getLevel().getName()); Assertions.assertEquals(msg, logRecord.getMessage()); } @Override Logger getLogger() { return logger; } @Override Class getLoggerClass() { return JBossLogManagerLogger.class; } private static TestHandler createHandler(final LogContext logContext, final String loggerName) { final TestHandler handler = new TestHandler(); final java.util.logging.Logger julLogger = logContext.getLogger(loggerName); julLogger.addHandler(handler); julLogger.setLevel(Level.ALL); return handler; } private static class TestHandler extends Handler { final BlockingQueue queue = new LinkedBlockingQueue<>(); @Override public void publish(final LogRecord record) { queue.add(record); } @Override public void flush() { } @Override public void close() throws SecurityException { queue.clear(); } } } jboss-logging-3.4.3.Final/src/test/java/org/jboss/logging/JulClassPathTestCase.java000066400000000000000000000016271416737514500302200ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2020 Red Hat, Inc. * * Licensed 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.jboss.logging; /** * @author James R. Perkins */ public class JulClassPathTestCase extends AbstractClassPathTestCase { @Override Class getLoggerClass() { return JDKLogger.class; } } jboss-logging-3.4.3.Final/src/test/java/org/jboss/logging/JulProviderTestCase.java000066400000000000000000000075321416737514500301310ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2020 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.LogRecord; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; /** * @author James R. Perkins */ public class JulProviderTestCase extends AbstractLoggerTestCase { private TestHandler handler; private Logger logger; @BeforeAll public static void setup() { System.setProperty("org.jboss.logging.provider", "jdk"); } @BeforeEach public void setupLogContext() { logger = Logger.getLogger(getClass()); handler = createHandler(logger.getName()); } @AfterEach public void removeHandler() { java.util.logging.Logger.getLogger(logger.getName()).removeHandler(handler); handler.close(); } @Test public void testMdc() { MDC.put("test.key", "value"); Assertions.assertEquals("value", MDC.get("test.key")); } @Test public void testNdc() { NDC.push("value1"); NDC.push("value2"); Assertions.assertEquals("value2", NDC.peek()); Assertions.assertEquals("value1 value2", NDC.get()); Assertions.assertEquals(2, NDC.getDepth()); // Pop the stack Assertions.assertEquals("value2", NDC.pop()); Assertions.assertEquals(1, NDC.getDepth()); Assertions.assertEquals("value1", NDC.get()); } @Override void testLog(final Logger.Level level) { final String msg = String.format("Test log message at %s", level); logger.log(level, msg); Assertions.assertTrue(logger.isEnabled(level), String.format("Logger not enabled for level %s", level)); testLog(msg, level); } @Override void testLog(final String msg, final Logger.Level level) { final LogRecord logRecord = handler.queue.poll(); Assertions.assertNotNull(logRecord, String.format("No record found for %s", level)); Assertions.assertEquals(level.name(), logRecord.getLevel().getName()); Assertions.assertEquals(msg, logRecord.getMessage()); } @Override Logger getLogger() { return logger; } @Override Class getLoggerClass() { return JDKLogger.class; } private static TestHandler createHandler(final String loggerName) { final TestHandler handler = new TestHandler(); final java.util.logging.Logger julLogger = java.util.logging.Logger.getLogger(loggerName); julLogger.addHandler(handler); julLogger.setLevel(Level.ALL); return handler; } private static class TestHandler extends Handler { final BlockingQueue queue = new LinkedBlockingQueue<>(); @Override public void publish(final LogRecord record) { queue.add(record); } @Override public void flush() { } @Override public void close() throws SecurityException { queue.clear(); } } } jboss-logging-3.4.3.Final/src/test/java/org/jboss/logging/Log4j2ClassPathTestCase.java000066400000000000000000000016351416737514500305260ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2020 Red Hat, Inc. * * Licensed 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.jboss.logging; /** * @author James R. Perkins */ public class Log4j2ClassPathTestCase extends AbstractClassPathTestCase { @Override Class getLoggerClass() { return Log4j2Logger.class; } } jboss-logging-3.4.3.Final/src/test/java/org/jboss/logging/Log4j2ProviderTestCase.java000066400000000000000000000134621416737514500304370ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2020 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.io.Serializable; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.ThreadContext; import org.apache.logging.log4j.core.Filter; import org.apache.logging.log4j.core.Layout; import org.apache.logging.log4j.core.LogEvent; import org.apache.logging.log4j.core.LoggerContext; import org.apache.logging.log4j.core.appender.AbstractAppender; import org.apache.logging.log4j.core.config.Configuration; import org.apache.logging.log4j.core.config.plugins.Plugin; import org.apache.logging.log4j.core.config.plugins.PluginAttribute; import org.apache.logging.log4j.core.config.plugins.PluginElement; import org.apache.logging.log4j.core.config.plugins.PluginFactory; import org.apache.logging.log4j.core.layout.PatternLayout; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; /** * @author James R. Perkins */ public class Log4j2ProviderTestCase extends AbstractLoggerTestCase { private TestAppender appender; private Logger logger; @BeforeAll public static void setup() { System.setProperty("org.jboss.logging.provider", "log4j2"); } @BeforeEach public void setupLogContext() { logger = Logger.getLogger(getClass()); final LoggerContext ctx = (LoggerContext) LogManager.getContext(false); final Configuration config = ctx.getConfiguration(); appender = (TestAppender) config.getAppenders().get("TestAppender"); } @Test public void testMdc() { MDC.put("test.key", "value"); Assertions.assertEquals("value", MDC.get("test.key")); Assertions.assertEquals("value", ThreadContext.get("test.key")); } @Test public void testNdc() { NDC.push("value1"); NDC.push("value2"); Assertions.assertEquals("value2", NDC.peek()); // TODO (jrp) This is a weird case we should validate. NDC.get() does ThreadContext.peek() which doesn't seem // TODO (jrp) correct. The method should likely do ThreadContext.getImmutableStack().toString(). At least that // TODO (jrp) is what the NdcPatternConverter does. //Assertions.assertEquals("[value1, value2]", NDC.get()); Assertions.assertEquals(2, NDC.getDepth()); // Test the log manager values Assertions.assertEquals("[value1, value2]", ThreadContext.getImmutableStack().toString()); Assertions.assertEquals(2, ThreadContext.getDepth()); // Pop the stack Assertions.assertEquals("value2", NDC.pop()); Assertions.assertEquals(1, NDC.getDepth()); Assertions.assertEquals("value1", NDC.get()); Assertions.assertEquals("value1", ThreadContext.peek()); Assertions.assertEquals(1, ThreadContext.getDepth()); } @Override void testLog(final Logger.Level level) { final String msg = String.format("Test log message at %s", level); logger.log(level, msg); Assertions.assertTrue(logger.isEnabled(level), String.format("Logger not enabled for level %s", level)); testLog(msg, level); } @Override void testLog(final String msg, final Logger.Level level) { final LogEvent event = appender.queue.poll(); Assertions.assertNotNull(event, String.format("No record found for %s", level)); Assertions.assertEquals(level.name(), event.getLevel().toString()); Assertions.assertEquals(msg, event.getMessage().getFormattedMessage()); } @Override Logger getLogger() { return logger; } @Override Class getLoggerClass() { return Log4j2Logger.class; } @SuppressWarnings("unused") @Plugin(name = "TestAppender", category = "Core", elementType = "appender", printObject = true) public static class TestAppender extends AbstractAppender { final BlockingQueue queue = new LinkedBlockingQueue<>(); protected TestAppender(String name, Filter filter, Layout layout) { super(name, filter, layout, false, null); } @Override public void append(final LogEvent event) { queue.add(event.toImmutable()); } @Override public void stop() { queue.clear(); super.stop(); } @PluginFactory public static TestAppender createAppender(@PluginAttribute("name") String name, @PluginElement("Layout") Layout layout, @PluginElement("Filter") final Filter filter, @PluginAttribute("otherAttribute") String otherAttribute) { if (name == null) { LOGGER.error("No name provided for TestAppender"); return null; } if (layout == null) { layout = PatternLayout.createDefaultLayout(); } return new TestAppender(name, filter, layout); } } } jboss-logging-3.4.3.Final/src/test/java/org/jboss/logging/Log4jClassPathTestCase.java000066400000000000000000000016331416737514500304420ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2020 Red Hat, Inc. * * Licensed 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.jboss.logging; /** * @author James R. Perkins */ public class Log4jClassPathTestCase extends AbstractClassPathTestCase { @Override Class getLoggerClass() { return Log4jLogger.class; } } jboss-logging-3.4.3.Final/src/test/java/org/jboss/logging/Log4jProviderTestCase.java000066400000000000000000000105201416737514500303450ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2020 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import org.apache.log4j.AppenderSkeleton; import org.apache.log4j.Level; import org.apache.log4j.spi.LoggingEvent; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; /** * @author James R. Perkins */ public class Log4jProviderTestCase extends AbstractLoggerTestCase { private TestAppender appender; private Logger logger; @BeforeAll public static void setup() { System.setProperty("org.jboss.logging.provider", "log4j"); } @BeforeEach public void setupLogContext() { logger = Logger.getLogger(getClass()); appender = createAppender(logger.getName()); } @AfterEach public void removeAppender() { org.apache.log4j.Logger.getLogger(logger.getName()).removeAppender(appender); appender.close(); } @Test public void testMdc() { MDC.put("test.key", "value"); Assertions.assertEquals("value", MDC.get("test.key")); Assertions.assertEquals("value", org.apache.log4j.MDC.get("test.key")); } @Test public void testNdc() { NDC.push("value1"); NDC.push("value2"); Assertions.assertEquals("value2", NDC.peek()); Assertions.assertEquals("value1 value2", NDC.get()); Assertions.assertEquals(2, NDC.getDepth()); // Test the log manager values Assertions.assertEquals("value1 value2", org.apache.log4j.NDC.get()); Assertions.assertEquals(2, org.apache.log4j.NDC.getDepth()); // Pop the stack Assertions.assertEquals("value2", NDC.pop()); Assertions.assertEquals(1, NDC.getDepth()); Assertions.assertEquals("value1", NDC.get()); Assertions.assertEquals("value1", org.apache.log4j.NDC.get()); Assertions.assertEquals(1, org.apache.log4j.NDC.getDepth()); } @Override void testLog(final Logger.Level level) { final String msg = String.format("Test log message at %s", level); logger.log(level, msg); Assertions.assertTrue(logger.isEnabled(level), String.format("Logger not enabled for level %s", level)); testLog(msg, level); } @Override void testLog(final String msg, final Logger.Level level) { final LoggingEvent event = appender.queue.poll(); Assertions.assertNotNull(event, String.format("No record found for %s", level)); Assertions.assertEquals(level.name(), event.getLevel().toString()); Assertions.assertEquals(msg, event.getMessage()); } @Override Logger getLogger() { return logger; } @Override Class getLoggerClass() { return Log4jLogger.class; } private static TestAppender createAppender(final String loggerName) { final TestAppender appender = new TestAppender(); final org.apache.log4j.Logger log4jLogger = org.apache.log4j.Logger.getLogger(loggerName); log4jLogger.addAppender(appender); log4jLogger.setLevel(Level.ALL); return appender; } private static class TestAppender extends AppenderSkeleton { final BlockingQueue queue = new LinkedBlockingQueue<>(); @Override protected void append(final LoggingEvent loggingEvent) { queue.add(loggingEvent); } @Override public void close() throws SecurityException { queue.clear(); } @Override public boolean requiresLayout() { return false; } } } jboss-logging-3.4.3.Final/src/test/java/org/jboss/logging/Slf4jClassPathTestCase.java000066400000000000000000000016501416737514500304440ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2020 Red Hat, Inc. * * Licensed 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.jboss.logging; /** * @author James R. Perkins */ public class Slf4jClassPathTestCase extends AbstractClassPathTestCase { @Override Class getLoggerClass() { return Slf4jLocationAwareLogger.class; } } jboss-logging-3.4.3.Final/src/test/java/org/jboss/logging/Slf4jProviderTestCase.java000066400000000000000000000104061416737514500303530ustar00rootroot00000000000000/* * JBoss, Home of Professional Open Source. * * Copyright 2020 Red Hat, Inc. * * Licensed 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.jboss.logging; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.AppenderBase; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.slf4j.LoggerFactory; /** * @author James R. Perkins */ public class Slf4jProviderTestCase extends AbstractLoggerTestCase { private TestAppender appender; private Logger logger; @BeforeAll public static void setup() { System.setProperty("org.jboss.logging.provider", "slf4j"); } @BeforeEach public void setupLogContext() { logger = Logger.getLogger(getClass()); appender = createHandler(logger.getName()); } @AfterEach public void removeAppender() { ch.qos.logback.classic.Logger lbLogger = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(logger.getName()); lbLogger.detachAppender(appender); appender.stop(); } @Test public void testMdc() { MDC.put("test.key", "value"); Assertions.assertEquals("value", MDC.get("test.key")); Assertions.assertEquals("value", org.slf4j.MDC.get("test.key")); } @Test public void testNdc() { NDC.push("value1"); NDC.push("value2"); Assertions.assertEquals("value2", NDC.peek()); Assertions.assertEquals("value1 value2", NDC.get()); Assertions.assertEquals(2, NDC.getDepth()); // Pop the stack Assertions.assertEquals("value2", NDC.pop()); Assertions.assertEquals(1, NDC.getDepth()); Assertions.assertEquals("value1", NDC.get()); } @Override void testLog(final Logger.Level level) { final String msg = String.format("Test log message at %s", level); logger.log(level, msg); Assertions.assertTrue(logger.isEnabled(level), String.format("Logger not enabled for level %s", level)); testLog(msg, level); } @Override void testLog(final String msg, final Logger.Level level) { final ILoggingEvent event = appender.queue.poll(); Assertions.assertNotNull(event, String.format("No record found for %s", level)); final Logger.Level translatedLevel = level == Logger.Level.FATAL ? Logger.Level.ERROR : level; Assertions.assertEquals(translatedLevel.name(), event.getLevel().toString()); Assertions.assertEquals(msg, event.getFormattedMessage()); } @Override Logger getLogger() { return logger; } @Override Class getLoggerClass() { return Slf4jLocationAwareLogger.class; } private static TestAppender createHandler(final String loggerName) { final LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); final TestAppender appender = new TestAppender(); appender.setContext(context); appender.start(); ch.qos.logback.classic.Logger lbLogger = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(loggerName); lbLogger.addAppender(appender); lbLogger.setLevel(Level.ALL); return appender; } public static class TestAppender extends AppenderBase { final BlockingQueue queue = new LinkedBlockingQueue<>(); @Override protected void append(final ILoggingEvent event) { queue.add(event); } } } jboss-logging-3.4.3.Final/src/test/resources/000077500000000000000000000000001416737514500211125ustar00rootroot00000000000000jboss-logging-3.4.3.Final/src/test/resources/META-INF/000077500000000000000000000000001416737514500222525ustar00rootroot00000000000000jboss-logging-3.4.3.Final/src/test/resources/META-INF/services/000077500000000000000000000000001416737514500240755ustar00rootroot00000000000000jboss-logging-3.4.3.Final/src/test/resources/META-INF/services/org.jboss.logging.LoggerProvider000066400000000000000000000000651416737514500323050ustar00rootroot00000000000000org.jboss.logging.CustomProviderTestCase$TestProviderjboss-logging-3.4.3.Final/src/test/resources/log4j2-test.xml000066400000000000000000000021741416737514500237160ustar00rootroot00000000000000