├── .gitignore ├── LICENSE.txt ├── README.md ├── binderVersion.pl ├── codeStyle.xml ├── goVersion.sh ├── integration ├── build.xml ├── lib │ ├── junit-3.8.1.jar │ ├── slf4j-api-1.5.11.jar │ ├── slf4j-api-1.6.6.jar │ ├── slf4j-api-1.6.99.jar │ ├── slf4j-api-2.0.99.jar │ ├── slf4j-nop-1.5.6.jar │ ├── slf4j-simple-1.4.2.jar │ ├── slf4j-simple-1.5.0.jar │ ├── slf4j-simple-1.5.11.jar │ ├── slf4j-simple-1.5.4-SNAPSHOT.jar │ ├── slf4j-simple-1.6.6.jar │ └── slf4j-simple-1.6.99.jar ├── osgi-build.xml ├── pom.xml └── src │ ├── IBUNDLE-META-INF │ └── MANIFEST.MF │ └── test │ └── java │ ├── integrator │ └── Activator.java │ └── org │ └── slf4j │ ├── CompatibilityAssertionTest.java │ ├── IncompatibleMultiBindingAssertionTest.java │ ├── MissingSingletonMethodAssertionTest.java │ ├── MultiBindingAssertionTest.java │ ├── StringPrintStream.java │ ├── VersionMismatchAssertionTest.java │ └── test_osgi │ ├── BundleTest.java │ ├── CheckingBundleListener.java │ ├── FelixHost.java │ └── FrameworkErrorListener.java ├── jcl-over-slf4j ├── LICENSE.txt ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── commons │ │ │ └── logging │ │ │ ├── Log.java │ │ │ ├── LogConfigurationException.java │ │ │ ├── LogFactory.java │ │ │ ├── impl │ │ │ ├── NoOpLog.java │ │ │ ├── SLF4JLocationAwareLog.java │ │ │ ├── SLF4JLog.java │ │ │ ├── SLF4JLogFactory.java │ │ │ ├── SimpleLog.java │ │ │ └── package.html │ │ │ └── package.html │ └── resources │ │ └── META-INF │ │ ├── MANIFEST.MF │ │ └── services │ │ └── org.apache.commons.logging.LogFactory │ └── test │ └── java │ └── org │ └── apache │ └── commons │ └── logging │ ├── InvokeJCLTest.java │ └── impl │ └── SerializationTest.java ├── jul-to-slf4j ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── slf4j │ │ │ └── bridge │ │ │ ├── SLF4JBridgeHandler.java │ │ │ └── package.html │ └── resources │ │ └── META-INF │ │ └── MANIFEST.MF │ └── test │ ├── java │ └── org │ │ └── slf4j │ │ └── bridge │ │ ├── ListAppender.java │ │ ├── SLF4JBridgeHandlerPerfTest.java │ │ └── SLF4JBridgeHandlerTest.java │ └── resources │ └── org │ └── slf4j │ └── bridge │ └── testLogStrings.properties ├── log4j-over-slf4j ├── compatibility │ ├── build.xml │ ├── lib │ │ ├── junit-3.8.1.jar │ │ ├── log4j-1.2.14.jar │ │ ├── log4j-1.3alpha-8.jar │ │ ├── log4j-over-slf4j-1.4.2.jar │ │ ├── logback-classic-0.9.8-SNAPSHOT.jar │ │ ├── logback-core-0.9.8-SNAPSHOT.jar │ │ └── slf4j-api-1.4.2.jar │ ├── readme.txt │ └── src │ │ └── main │ │ └── java │ │ └── test │ │ ├── DummyObject.java │ │ ├── Log4j12Calls.java │ │ ├── Log4j13Calls.java │ │ └── LoggerTest.java ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── log4j │ │ │ ├── Appender.java │ │ │ ├── BasicConfigurator.java │ │ │ ├── Category.java │ │ │ ├── Layout.java │ │ │ ├── Level.java │ │ │ ├── Log4jLoggerFactory.java │ │ │ ├── LogManager.java │ │ │ ├── Logger.java │ │ │ ├── MDC.java │ │ │ ├── NDC.java │ │ │ ├── PatternLayout.java │ │ │ ├── Priority.java │ │ │ ├── PropertyConfigurator.java │ │ │ ├── RollingFileAppender.java │ │ │ ├── helpers │ │ │ ├── LogLog.java │ │ │ └── NullEnumeration.java │ │ │ ├── package.html │ │ │ ├── spi │ │ │ ├── Configurator.java │ │ │ ├── ErrorHandler.java │ │ │ ├── Filter.java │ │ │ ├── HierarchyEventListener.java │ │ │ ├── Layout.java │ │ │ ├── LoggerFactory.java │ │ │ ├── LoggerRepository.java │ │ │ └── LoggingEvent.java │ │ │ └── xml │ │ │ └── DOMConfigurator.java │ └── resources │ │ └── META-INF │ │ └── MANIFEST.MF │ └── test │ └── java │ └── org │ ├── apache │ └── log4j │ │ ├── NDCTest.java │ │ └── Trivial.java │ └── dummy │ ├── Bug131.java │ ├── Bug139.java │ └── ListHandler.java ├── osgi-over-slf4j ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── slf4j │ └── osgi │ └── logservice │ └── impl │ ├── Activator.java │ ├── LogServiceFactory.java │ └── LogServiceImpl.java ├── pom.xml ├── slf4j-android ├── .gitignore ├── AndroidManifest.xml ├── pom.xml ├── project.properties └── src │ ├── main │ └── java │ │ └── org │ │ └── slf4j │ │ └── impl │ │ ├── AndroidLogger.java │ │ ├── AndroidLoggerFactory.java │ │ ├── StaticLoggerBinder.java │ │ ├── StaticMDCBinder.java │ │ └── StaticMarkerBinder.java │ └── site │ └── index.html ├── slf4j-api ├── LICENSE.txt ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── slf4j │ │ │ ├── ILoggerFactory.java │ │ │ ├── IMarkerFactory.java │ │ │ ├── Logger.java │ │ │ ├── LoggerFactory.java │ │ │ ├── MDC.java │ │ │ ├── Marker.java │ │ │ ├── MarkerFactory.java │ │ │ ├── helpers │ │ │ ├── BasicMDCAdapter.java │ │ │ ├── BasicMarker.java │ │ │ ├── BasicMarkerFactory.java │ │ │ ├── FormattingTuple.java │ │ │ ├── MarkerIgnoringBase.java │ │ │ ├── MessageFormatter.java │ │ │ ├── NOPLogger.java │ │ │ ├── NOPLoggerFactory.java │ │ │ ├── NOPMDCAdapter.java │ │ │ ├── NamedLoggerBase.java │ │ │ ├── SubstituteLoggerFactory.java │ │ │ ├── Util.java │ │ │ └── package.html │ │ │ ├── impl │ │ │ ├── StaticLoggerBinder.java │ │ │ ├── StaticMDCBinder.java │ │ │ ├── StaticMarkerBinder.java │ │ │ └── package.html │ │ │ ├── package.html │ │ │ └── spi │ │ │ ├── LocationAwareLogger.java │ │ │ ├── LoggerFactoryBinder.java │ │ │ ├── MDCAdapter.java │ │ │ ├── MarkerFactoryBinder.java │ │ │ └── package.html │ └── resources │ │ └── META-INF │ │ └── MANIFEST.MF │ └── test │ └── java │ └── org │ └── slf4j │ ├── BasicMarkerTest.java │ ├── Differentiator.java │ ├── NoBindingTest.java │ └── helpers │ ├── BogoPerf.java │ ├── BubbleSort.java │ ├── BubbleSortTest.java │ ├── MessageFormatterPerfTest.java │ ├── MessageFormatterTest.java │ └── MyRandom.java ├── slf4j-ext ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── slf4j │ │ │ ├── NDC.java │ │ │ ├── agent │ │ │ ├── AgentOptions.java │ │ │ ├── AgentPremain.java │ │ │ └── package.html │ │ │ ├── cal10n │ │ │ ├── LocLogger.java │ │ │ ├── LocLoggerFactory.java │ │ │ └── package.html │ │ │ ├── ext │ │ │ ├── EventData.java │ │ │ ├── EventException.java │ │ │ ├── EventLogger.java │ │ │ ├── LoggerWrapper.java │ │ │ ├── MDCStrLookup.java │ │ │ ├── XLogger.java │ │ │ ├── XLoggerFactory.java │ │ │ └── package.html │ │ │ ├── instrumentation │ │ │ ├── JavassistHelper.java │ │ │ ├── LogTransformer.java │ │ │ ├── ToStringHelper.java │ │ │ └── package.html │ │ │ └── profiler │ │ │ ├── DurationUnit.java │ │ │ ├── Profiler.java │ │ │ ├── ProfilerRegistry.java │ │ │ ├── SpacePadder.java │ │ │ ├── StopWatch.java │ │ │ ├── TimeInstrument.java │ │ │ ├── TimeInstrumentStatus.java │ │ │ ├── Util.java │ │ │ └── package.html │ └── resources │ │ └── META-INF │ │ └── MANIFEST.MF │ └── test │ ├── java │ └── org │ │ └── slf4j │ │ ├── NDCTest.java │ │ ├── cal10n_dummy │ │ ├── LocLoggerTest.java │ │ ├── Months.java │ │ ├── MyApplication.java │ │ ├── PackageTest.java │ │ └── Production.java │ │ ├── dummyExt │ │ ├── EventLoggerTest.java │ │ ├── ListAppender.java │ │ ├── MDCStrLookupTest.java │ │ ├── PackageTest.java │ │ ├── XLoggerTest.java │ │ └── package.html │ │ ├── instrumentation │ │ └── ToStringHelperTest.java │ │ └── profiler │ │ ├── BasicProfilerDemo.java │ │ ├── NestedProfilerDemo.java │ │ ├── NestedProfilerDemo2.java │ │ ├── PackageTest.java │ │ ├── ProfilerTest.java │ │ ├── RandomIntegerArrayGenerator.java │ │ ├── SortAndPruneComposites.java │ │ └── UtilTest.java │ └── resources │ ├── log4j.properties │ └── months_en.properties ├── slf4j-jcl ├── LICENSE.txt ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── slf4j │ │ │ └── impl │ │ │ ├── JCLLoggerAdapter.java │ │ │ ├── JCLLoggerFactory.java │ │ │ ├── StaticLoggerBinder.java │ │ │ ├── StaticMDCBinder.java │ │ │ └── StaticMarkerBinder.java │ └── resources │ │ └── META-INF │ │ └── MANIFEST.MF │ └── test │ └── java │ └── org │ └── slf4j │ └── InvocationTest.java ├── slf4j-jdk14 ├── LICENSE.txt ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── slf4j │ │ │ └── impl │ │ │ ├── JDK14LoggerAdapter.java │ │ │ ├── JDK14LoggerFactory.java │ │ │ ├── StaticLoggerBinder.java │ │ │ ├── StaticMDCBinder.java │ │ │ └── StaticMarkerBinder.java │ └── resources │ │ └── META-INF │ │ └── MANIFEST.MF │ └── test │ └── java │ └── org │ └── slf4j │ ├── InvocationTest.java │ ├── impl │ ├── JDK14AdapterLoggerNameTest.java │ └── PerfTest.java │ └── issue │ └── LoggerSerializationTest.java ├── slf4j-log4j12 ├── LICENSE.txt ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── slf4j │ │ │ └── impl │ │ │ ├── Log4jLoggerAdapter.java │ │ │ ├── Log4jLoggerFactory.java │ │ │ ├── Log4jMDCAdapter.java │ │ │ ├── StaticLoggerBinder.java │ │ │ ├── StaticMDCBinder.java │ │ │ └── StaticMarkerBinder.java │ └── resources │ │ └── META-INF │ │ └── MANIFEST.MF │ └── test │ ├── java │ └── org │ │ └── slf4j │ │ ├── InvocationTest.java │ │ ├── ListAppender.java │ │ └── impl │ │ ├── RecursiveAppender.java │ │ └── RecursiveInitializationTest.java │ └── resources │ └── recursiveInit.properties ├── slf4j-migrator ├── LIMITATIONS.txt ├── jcl │ └── jclcontent.java ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── slf4j │ │ │ └── migrator │ │ │ ├── Constant.java │ │ │ ├── ConversionException.java │ │ │ ├── FileSelector.java │ │ │ ├── InplaceFileConverter.java │ │ │ ├── Main.java │ │ │ ├── ProjectConverter.java │ │ │ ├── RuleSetFactory.java │ │ │ ├── helper │ │ │ ├── Abbreviator.java │ │ │ └── SpringLayoutHelper.java │ │ │ ├── internal │ │ │ ├── ConversionTask.java │ │ │ ├── MigratorFrame.java │ │ │ ├── ProgressListener.java │ │ │ └── ProgressListenerImpl.java │ │ │ └── line │ │ │ ├── ConversionRule.java │ │ │ ├── EmptyRuleSet.java │ │ │ ├── JCLRuleSet.java │ │ │ ├── JULRuleSet.java │ │ │ ├── LineConverter.java │ │ │ ├── Log4jRuleSet.java │ │ │ ├── MultiGroupConversionRule.java │ │ │ ├── RuleSet.java │ │ │ └── SingleConversionRule.java │ └── resources │ │ └── META-INF │ │ └── MANIFEST.MF │ └── test │ └── java │ └── org │ └── slf4j │ └── migrator │ ├── AllTest.java │ ├── AternativeApproach.java │ ├── FileConverterTest.java │ ├── PackageTest.java │ ├── ProjectConverterTest.java │ ├── helper │ ├── AbbreviatorTest.java │ ├── PackageTest.java │ └── RandomHelper.java │ ├── internal │ └── NopProgressListener.java │ └── line │ ├── JCLRuleSetTest.java │ ├── Log4jRuleSetTest.java │ ├── NoConversionTest.java │ ├── PackageTest.java │ ├── TrivialMatcherTest.java │ └── TriviialMatcher.java ├── slf4j-nop ├── LICENSE.txt ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── slf4j │ │ │ └── impl │ │ │ ├── StaticLoggerBinder.java │ │ │ ├── StaticMDCBinder.java │ │ │ └── StaticMarkerBinder.java │ └── resources │ │ └── META-INF │ │ └── MANIFEST.MF │ └── test │ └── java │ └── org │ └── slf4j │ └── InvocationTest.java ├── slf4j-simple ├── LICENSE.txt ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── slf4j │ │ │ └── impl │ │ │ ├── SimpleLogger.java │ │ │ ├── SimpleLoggerFactory.java │ │ │ ├── StaticLoggerBinder.java │ │ │ ├── StaticMDCBinder.java │ │ │ └── StaticMarkerBinder.java │ └── resources │ │ └── META-INF │ │ └── MANIFEST.MF │ └── test │ ├── java │ └── org │ │ └── slf4j │ │ ├── InvocationTest.java │ │ ├── SilentPrintStream.java │ │ └── impl │ │ └── SimpleLoggerTest.java │ └── resources │ └── simplelogger.properties ├── slf4j-site ├── LICENSE.txt ├── pom.xml └── src │ └── site │ ├── images.src │ ├── bindings.flw │ ├── bridging-black.flw │ ├── bridging.flw │ ├── concrete-bindings.odg │ ├── core-bindings.flw │ ├── core-bindings1.flw │ ├── core-bindings2.flw │ ├── core-bindings3.flw │ └── legacy.odg │ ├── pages │ ├── .htaccess │ ├── bug-reporting.html │ ├── changes │ │ └── changes-1.3.txt │ ├── codes.html │ ├── compatibility.html │ ├── css │ │ ├── popup.css │ │ ├── prettify.css │ │ └── site.css │ ├── docs.html │ ├── download.html │ ├── extensions.html │ ├── faq.html │ ├── inde_base.html │ ├── index.html │ ├── js │ │ ├── decorator.js │ │ ├── jquery-min.js │ │ ├── jquery.cookies.2.2.0.js │ │ ├── popup.js │ │ └── prettify.js │ ├── legacy.html │ ├── license.html │ ├── localization.html │ ├── mailing-lists.html │ ├── manual.html │ ├── migrator.html │ ├── news.html │ ├── support.html │ └── templates │ │ ├── footer.js │ │ ├── header.js │ │ ├── left.js │ │ └── right.js │ └── resources │ ├── css │ ├── anchor12.png │ ├── anchor16.png │ ├── anchor20.png │ └── anchor24.png │ ├── images │ ├── PythonPowered.png │ ├── bindings.png │ ├── bridging.png │ ├── buyDirect.jpg │ ├── concrete-bindings.png │ ├── devoxx09.jpeg │ ├── gnu-head-tiny.jpg │ ├── jazoon09.gif │ ├── legacy.png │ ├── logos │ │ ├── qosLogo.png │ │ ├── qoslogo.gif │ │ ├── slf4j-logo.jpg │ │ ├── slf4j-small.jpg │ │ └── valid-html401.png │ ├── mailman.jpg │ ├── myjob.png │ ├── slf4j-migrator.gif │ └── twitter-bird-light-bgs.png │ └── slf4j-in-10-slides.ppt ├── src └── main │ ├── assembly │ └── source.xml │ ├── javadocHeaders.xml │ └── licenseHeader.txt ├── test └── version.pl /.gitignore: -------------------------------------------------------------------------------- 1 | .settings 2 | target 3 | .classpath 4 | .project 5 | *~ 6 | *.tmproj 7 | *.iml 8 | .idea 9 | .scala_dependencies 10 | integration/bundle/ 11 | integration/felix-cache/ 12 | runner 13 | 14 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2008 QOS.ch 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | slf4j-android 2 | ============= 3 | 4 | Fork of the Simple Logging Facade for Java (SLF4J) that adds a logger binding for the Android platform. 5 | -------------------------------------------------------------------------------- /binderVersion.pl: -------------------------------------------------------------------------------- 1 | 2 | if ($#ARGV < 1) { 3 | print "Usage: binderVersion.pl VER FILE {FILE, FILE}\n"; 4 | exit; 5 | } 6 | 7 | $V= $ARGV[0]; 8 | # Trim -SNAPSHOT 9 | $V =~ s/-SNAPSHOT//; 10 | 11 | print "VER:${V}\r\n"; 12 | shift(@ARGV); 13 | 14 | sub replace () { 15 | my $filename = $_[0]; 16 | 17 | if(-s $filename) { 18 | print "Processing [" . $filename . "]\r\n"; 19 | 20 | my $original = "$filename.original"; 21 | 22 | rename($filename, $original); 23 | open(OUT, ">$filename"); 24 | open(IN, "$original"); 25 | 26 | while() { 27 | if(/VERSION\s+=\s+".*";/) { 28 | s/VERSION\s+=\s+".*";/VERSION = "${V}";/; 29 | } 30 | print OUT; 31 | } 32 | close(IN); 33 | close(OUT); 34 | unlink($original); 35 | } else { 36 | print "File [" . $filename . "] does not exist\r\n" 37 | } 38 | } 39 | 40 | foreach $ARG (@ARGV) { 41 | do replace($ARG); 42 | } 43 | -------------------------------------------------------------------------------- /goVersion.sh: -------------------------------------------------------------------------------- 1 | VER=$1 2 | echo "Will use version '${VER}'" 3 | echo "Changing pom.xml files" 4 | find . -name "pom.xml" |xargs perl version.pl ${VER} 5 | echo "Changing Java files" 6 | find . -name "StaticLoggerBinder.java" |xargs perl binderVersion.pl ${VER} 7 | 8 | -------------------------------------------------------------------------------- /integration/lib/junit-3.8.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/integration/lib/junit-3.8.1.jar -------------------------------------------------------------------------------- /integration/lib/slf4j-api-1.5.11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/integration/lib/slf4j-api-1.5.11.jar -------------------------------------------------------------------------------- /integration/lib/slf4j-api-1.6.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/integration/lib/slf4j-api-1.6.6.jar -------------------------------------------------------------------------------- /integration/lib/slf4j-api-1.6.99.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/integration/lib/slf4j-api-1.6.99.jar -------------------------------------------------------------------------------- /integration/lib/slf4j-api-2.0.99.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/integration/lib/slf4j-api-2.0.99.jar -------------------------------------------------------------------------------- /integration/lib/slf4j-nop-1.5.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/integration/lib/slf4j-nop-1.5.6.jar -------------------------------------------------------------------------------- /integration/lib/slf4j-simple-1.4.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/integration/lib/slf4j-simple-1.4.2.jar -------------------------------------------------------------------------------- /integration/lib/slf4j-simple-1.5.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/integration/lib/slf4j-simple-1.5.0.jar -------------------------------------------------------------------------------- /integration/lib/slf4j-simple-1.5.11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/integration/lib/slf4j-simple-1.5.11.jar -------------------------------------------------------------------------------- /integration/lib/slf4j-simple-1.5.4-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/integration/lib/slf4j-simple-1.5.4-SNAPSHOT.jar -------------------------------------------------------------------------------- /integration/lib/slf4j-simple-1.6.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/integration/lib/slf4j-simple-1.6.6.jar -------------------------------------------------------------------------------- /integration/lib/slf4j-simple-1.6.99.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/integration/lib/slf4j-simple-1.6.99.jar -------------------------------------------------------------------------------- /integration/src/IBUNDLE-META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Archiver-Version: Plexus Archiver 3 | Created-By: Apache Maven 4 | Built-By: ceki 5 | Build-Jdk: 1.6.0_16 6 | Bundle-Description: iBundle 7 | Bundle-Version: 0.1 8 | Bundle-Activator: integrator.Activator 9 | Implementation-Title: iBundle 10 | Bundle-ManifestVersion: 2 11 | Bundle-SymbolicName: iBundle 12 | Bundle-Name: abundle 13 | Bundle-RequiredExecutionEnvironment: J2SE-1.3 14 | Export-Package: apack 15 | Import-Package: org.osgi.framework, org.slf4j;version=1.5 -------------------------------------------------------------------------------- /integration/src/test/java/integrator/Activator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package integrator; 26 | 27 | import org.osgi.framework.Bundle; 28 | import org.osgi.framework.BundleActivator; 29 | import org.osgi.framework.BundleContext; 30 | import org.slf4j.Logger; 31 | import org.slf4j.LoggerFactory; 32 | 33 | /** 34 | * A BundleActivator which invokes slf4j loggers 35 | * @author Ceki Gülcü 36 | * 37 | */ 38 | public class Activator implements BundleActivator { 39 | 40 | private BundleContext m_context = null; 41 | 42 | public void start(BundleContext context) { 43 | Logger logger = LoggerFactory.getLogger(this.getClass()); 44 | logger.info("Activator.start()"); 45 | m_context = context; 46 | } 47 | 48 | public void stop(BundleContext context) { 49 | m_context = null; 50 | Logger logger = LoggerFactory.getLogger(this.getClass()); 51 | logger.info("Activator.stop"); 52 | } 53 | 54 | public Bundle[] getBundles() { 55 | if (m_context != null) { 56 | return m_context.getBundles(); 57 | } 58 | return null; 59 | } 60 | } -------------------------------------------------------------------------------- /integration/src/test/java/org/slf4j/CompatibilityAssertionTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | 26 | package org.slf4j; 27 | 28 | import java.io.PrintStream; 29 | import java.util.Random; 30 | 31 | import junit.framework.TestCase; 32 | 33 | public class CompatibilityAssertionTest extends TestCase { 34 | 35 | StringPrintStream sps = new StringPrintStream(System.err); 36 | PrintStream old = System.err; 37 | int diff = 1024 + new Random().nextInt(10000); 38 | 39 | public CompatibilityAssertionTest(String name) { 40 | super(name); 41 | } 42 | 43 | protected void setUp() throws Exception { 44 | super.setUp(); 45 | System.setErr(sps); 46 | } 47 | 48 | protected void tearDown() throws Exception { 49 | super.tearDown(); 50 | System.setErr(old); 51 | } 52 | 53 | 54 | public void test() throws Exception { 55 | Logger logger = LoggerFactory.getLogger(this.getClass()); 56 | String msg = "hello world "+diff; 57 | logger.info(msg); 58 | assertEquals(1, sps.stringList.size()); 59 | String s0 = (String) sps.stringList.get(0); 60 | assertTrue(s0.contains(msg)); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /integration/src/test/java/org/slf4j/StringPrintStream.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j; 26 | 27 | import java.io.PrintStream; 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | public class StringPrintStream extends PrintStream { 32 | 33 | public static final String LINE_SEP = System.getProperty("line.separator"); 34 | PrintStream other; 35 | List stringList = new ArrayList(); 36 | 37 | public StringPrintStream(PrintStream ps) { 38 | super(ps); 39 | other = ps; 40 | } 41 | 42 | public void print(String s) { 43 | other.print(s); 44 | stringList.add(s); 45 | } 46 | 47 | public void println(String s) { 48 | other.println(s); 49 | stringList.add(s); 50 | 51 | } 52 | 53 | public void println(Object o) { 54 | other.println(o); 55 | stringList.add(o); 56 | } 57 | } 58 | 59 | -------------------------------------------------------------------------------- /integration/src/test/java/org/slf4j/test_osgi/BundleTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.test_osgi; 26 | 27 | import java.io.File; 28 | 29 | import junit.framework.TestCase; 30 | 31 | public class BundleTest extends TestCase { 32 | 33 | FrameworkErrorListener fel = new FrameworkErrorListener(); 34 | CheckingBundleListener mbl = new CheckingBundleListener(); 35 | 36 | FelixHost felixHost = new FelixHost(fel, mbl); 37 | 38 | protected void setUp() throws Exception { 39 | super.setUp(); 40 | felixHost.doLaunch(); 41 | } 42 | 43 | protected void tearDown() throws Exception { 44 | super.tearDown(); 45 | felixHost.stop(); 46 | } 47 | 48 | public void testSmoke() { 49 | System.out.println("==========="+new File(".").getAbsolutePath()); 50 | mbl.dumpAll(); 51 | // check that the bundle was installed 52 | assertTrue(mbl.exists("iBundle")); 53 | if(fel.errorList.size() != 0) { 54 | fel.dumpAll(); 55 | } 56 | // check that no errors occured 57 | assertEquals(0, fel.errorList.size()); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /jcl-over-slf4j/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | org.slf4j 6 | slf4j-parent 7 | 1.7.5 8 | 9 | 10 | 4.0.0 11 | 12 | org.slf4j 13 | jcl-over-slf4j 14 | jar 15 | JCL 1.1.1 implemented over SLF4J 16 | JCL 1.1.1 implemented over SLF4J 17 | http://www.slf4j.org 18 | 19 | 20 | 21 | 29 | 30 | 31 | org.slf4j 32 | slf4j-api 33 | 34 | 35 | 36 | org.slf4j 37 | slf4j-jdk14 38 | test 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | org.apache.maven.plugins 47 | maven-jar-plugin 48 | 49 | 50 | 51 | ${parsedVersion.osgiVersion} 52 | ${project.description} 53 | ${project.version} 54 | 55 | ${project.build.outputDirectory}/META-INF/MANIFEST.MF 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /jcl-over-slf4j/src/main/java/org/apache/commons/logging/impl/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

SLF4J based implementation of commons-logging wrapper APIs.

4 | 5 | 6 | -------------------------------------------------------------------------------- /jcl-over-slf4j/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Implementation-Title: jcl-over-slf4j 2 | Bundle-ManifestVersion: 2 3 | Bundle-SymbolicName: jcl.over.slf4j 4 | Bundle-Name: jcl-over-slf4j 5 | Bundle-Vendor: SLF4J.ORG 6 | Bundle-RequiredExecutionEnvironment: J2SE-1.3 7 | Export-Package: org.apache.commons.logging;version=1.1.1, 8 | org.apache.commons.logging.impl;version=1.1.1 9 | Import-Package: org.slf4j;version=${parsedVersion.osgiVersion}, org.slf4j.spi;version=${parsedVersion.osgiVersion} 10 | -------------------------------------------------------------------------------- /jcl-over-slf4j/src/main/resources/META-INF/services/org.apache.commons.logging.LogFactory: -------------------------------------------------------------------------------- 1 | org.apache.commons.logging.impl.SLF4JLogFactory 2 | 3 | # Axis gets at JCL through its own mechanism as defined by Commons Discovery, which 4 | # in turn follows the instructions found at: 5 | # http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service Provider 6 | -------------------------------------------------------------------------------- /jul-to-slf4j/pom.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | org.slf4j 8 | slf4j-parent 9 | 1.7.5 10 | 11 | 12 | 4.0.0 13 | 14 | org.slf4j 15 | jul-to-slf4j 16 | 17 | jar 18 | JUL to SLF4J bridge 19 | JUL to SLF4J bridge 20 | 21 | http://www.slf4j.org 22 | 23 | 24 | 25 | org.slf4j 26 | slf4j-api 27 | 28 | 29 | org.slf4j 30 | slf4j-log4j12 31 | ${project.version} 32 | test 33 | 34 | 35 | 36 | 37 | 38 | 39 | org.apache.maven.plugins 40 | maven-compiler-plugin 41 | 42 | 1.4 43 | 1.4 44 | 45 | 46 | 47 | org.apache.maven.plugins 48 | maven-jar-plugin 49 | 50 | 51 | 52 | ${parsedVersion.osgiVersion} 53 | ${project.description} 54 | ${project.version} 55 | 56 | 57 | ${project.build.outputDirectory}/META-INF/MANIFEST.MF 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /jul-to-slf4j/src/main/java/org/slf4j/bridge/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |

Bridge/route all JUL log records to the SLF4J API.

12 | 13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /jul-to-slf4j/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Bundle-ManifestVersion: 2 2 | Bundle-SymbolicName: jul.to.slf4j 3 | Bundle-Name: jul-to-slf4j 4 | Bundle-Vendor: SLF4J.ORG 5 | Bundle-RequiredExecutionEnvironment: J2SE-1.3 6 | Export-Package: org.slf4j.bridge;version=${parsedVersion.osgiVersion};uses:="org.slf4j,org.slf4j.spi" 7 | Import-Package: org.slf4j;version=${parsedVersion.osgiVersion},org.slf4j.spi;version=${parsedVersion.osgiVersion} 8 | -------------------------------------------------------------------------------- /jul-to-slf4j/src/test/java/org/slf4j/bridge/ListAppender.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.bridge; 26 | 27 | import java.util.ArrayList; 28 | import java.util.List; 29 | 30 | import org.apache.log4j.AppenderSkeleton; 31 | import org.apache.log4j.spi.LoggingEvent; 32 | 33 | public class ListAppender extends AppenderSkeleton { 34 | 35 | public List list = new ArrayList(); 36 | 37 | public boolean extractLocationInfo = false; 38 | 39 | protected void append(LoggingEvent event) { 40 | list.add(event); 41 | if(extractLocationInfo) { 42 | event.getLocationInformation(); 43 | } 44 | } 45 | 46 | public void close() { 47 | } 48 | 49 | public boolean requiresLayout() { 50 | return false; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /jul-to-slf4j/src/test/resources/org/slf4j/bridge/testLogStrings.properties: -------------------------------------------------------------------------------- 1 | resource_key=msg 2 | resource_key_1=msg 3 | resource_key_2=msg {0} {1} 4 | -------------------------------------------------------------------------------- /log4j-over-slf4j/compatibility/lib/junit-3.8.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/log4j-over-slf4j/compatibility/lib/junit-3.8.1.jar -------------------------------------------------------------------------------- /log4j-over-slf4j/compatibility/lib/log4j-1.2.14.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/log4j-over-slf4j/compatibility/lib/log4j-1.2.14.jar -------------------------------------------------------------------------------- /log4j-over-slf4j/compatibility/lib/log4j-1.3alpha-8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/log4j-over-slf4j/compatibility/lib/log4j-1.3alpha-8.jar -------------------------------------------------------------------------------- /log4j-over-slf4j/compatibility/lib/log4j-over-slf4j-1.4.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/log4j-over-slf4j/compatibility/lib/log4j-over-slf4j-1.4.2.jar -------------------------------------------------------------------------------- /log4j-over-slf4j/compatibility/lib/logback-classic-0.9.8-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/log4j-over-slf4j/compatibility/lib/logback-classic-0.9.8-SNAPSHOT.jar -------------------------------------------------------------------------------- /log4j-over-slf4j/compatibility/lib/logback-core-0.9.8-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/log4j-over-slf4j/compatibility/lib/logback-core-0.9.8-SNAPSHOT.jar -------------------------------------------------------------------------------- /log4j-over-slf4j/compatibility/lib/slf4j-api-1.4.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/log4j-over-slf4j/compatibility/lib/slf4j-api-1.4.2.jar -------------------------------------------------------------------------------- /log4j-over-slf4j/compatibility/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | This directory is used to test the module against various log4j calls. 3 | Two test cases simulate the typical calls that one can find in an application 4 | that uses either log4j 1.2.x, or log4j 1.3.x. 5 | 6 | In the same directory is a build.xml file that uses ant to 7 | compile the test cases with the corresponding log4j version, 8 | and to runs these tests without log4j in the classpath but with 9 | logback jars instead. 10 | 11 | To run the tests, one must have ant installed. Issuing the following command, 12 | once in the compatibility directory will launch the tests: 13 | 14 | ant all 15 | 16 | To obtain more information about the use of the log4j-over-slf4j module, 17 | please visit http://www..slf4j.org/log4j-over-slf4j.html -------------------------------------------------------------------------------- /log4j-over-slf4j/compatibility/src/main/java/test/DummyObject.java: -------------------------------------------------------------------------------- 1 | package test; 2 | 3 | public class DummyObject { 4 | 5 | public String toString() { 6 | return "dummy"; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /log4j-over-slf4j/compatibility/src/main/java/test/Log4j12Calls.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Logback: the reliable, generic, fast and flexible logging framework. 3 | * 4 | * Copyright (C) 1999-2006, QOS.ch 5 | * 6 | * This library is free software, you can redistribute it and/or modify it under 7 | * the terms of the GNU Lesser General Public License as published by the Free 8 | * Software Foundation. 9 | */ 10 | package test; 11 | 12 | import junit.framework.TestCase; 13 | 14 | import org.apache.log4j.Logger; 15 | import org.apache.log4j.MDC; 16 | 17 | /** 18 | * 19 | * A test case that issues the typical calls 20 | * that an application using log4j 1.2 would do. 21 | * 22 | * @author Ceki Gülcü 23 | * @author Sébastien Pennec 24 | */ 25 | public class Log4j12Calls extends TestCase { 26 | public static final Logger logger = Logger.getLogger(Log4j12Calls.class); 27 | 28 | public void testLog() { 29 | MDC.put("key", "value1"); 30 | 31 | logger.trace("Trace level can be noisy"); 32 | logger.debug("Entering application"); 33 | logger.info("Violets are blue"); 34 | logger.warn("Here is a warning"); 35 | logger.error("Exiting application", new Exception("just testing")); 36 | 37 | MDC.remove("key"); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /log4j-over-slf4j/compatibility/src/main/java/test/Log4j13Calls.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Logback: the reliable, generic, fast and flexible logging framework. 3 | * 4 | * Copyright (C) 1999-2006, QOS.ch 5 | * 6 | * This library is free software, you can redistribute it and/or modify it under 7 | * the terms of the GNU Lesser General Public License as published by the Free 8 | * Software Foundation. 9 | */ 10 | 11 | package test; 12 | 13 | import junit.framework.TestCase; 14 | 15 | import org.apache.log4j.Logger; 16 | import org.apache.log4j.MDC; 17 | 18 | /** 19 | * 20 | * A test case that issues the typical calls 21 | * that an application using log4j 1.3 would do. 22 | * 23 | * @author Ceki Gülcü 24 | * @author Sébastien Pennec 25 | */ 26 | 27 | public class Log4j13Calls extends TestCase { 28 | public static final Logger logger = Logger.getLogger(Log4j12Calls.class); 29 | 30 | public void testLog() { 31 | MDC.put("key", "value1"); 32 | 33 | logger.trace("Trace level can be noisy"); 34 | logger.debug("Entering application"); 35 | logger.info("Violets are blue"); 36 | logger.warn("Here is a warning"); 37 | logger.info("The answer is {}.", new Integer(42)); 38 | logger.info("Number: {} and another one: {}.", new Integer(42), new Integer(24)); 39 | 40 | logger.error("Exiting application", new Exception("just testing")); 41 | 42 | MDC.remove("key"); 43 | 44 | MDC.clear(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /log4j-over-slf4j/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | org.slf4j 7 | slf4j-parent 8 | 1.7.5 9 | 10 | 11 | 4.0.0 12 | 13 | org.slf4j 14 | log4j-over-slf4j 15 | jar 16 | Log4j Implemented Over SLF4J 17 | Log4j implemented over SLF4J 18 | 19 | http://www.slf4j.org 20 | 21 | 22 | 23 | Apache Software Licenses 24 | http://www.apache.org/licenses/LICENSE-2.0.txt 25 | 26 | 27 | 28 | 29 | 30 | org.slf4j 31 | slf4j-api 32 | 33 | 34 | 35 | org.slf4j 36 | slf4j-jdk14 37 | test 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | org.apache.maven.plugins 46 | maven-jar-plugin 47 | 48 | 49 | 50 | ${parsedVersion.osgiVersion} 51 | ${project.description} 52 | ${project.version} 53 | 54 | ${project.build.outputDirectory}/META-INF/MANIFEST.MF 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/main/java/org/apache/log4j/BasicConfigurator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.log4j; 18 | 19 | /** 20 | * A minimal (nop) implementation of BasicConfigurator. 21 | */ 22 | public class BasicConfigurator { 23 | public static void configure() { 24 | } 25 | 26 | public static void configure(Appender appender) { 27 | } 28 | 29 | public static void resetConfiguration() { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/main/java/org/apache/log4j/Layout.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // Contributors: Christian Trutz 18 | package org.apache.log4j; 19 | 20 | /** 21 | * This class is a minimal implementation of the original Log4J class. 22 | * 23 | * @author Christian Trutz 24 | * */ 25 | public class Layout { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/main/java/org/apache/log4j/MDC.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.log4j; 18 | 19 | public class MDC { 20 | 21 | public static void put(String key, String value) { 22 | org.slf4j.MDC.put(key, value); 23 | } 24 | 25 | public static void put(String key, Object value) { 26 | if (value != null) { 27 | put(key, value.toString()); 28 | } else { 29 | put(key, null); 30 | } 31 | } 32 | 33 | public static Object get(String key) { 34 | return org.slf4j.MDC.get(key); 35 | } 36 | 37 | public static void remove(String key) { 38 | org.slf4j.MDC.remove(key); 39 | } 40 | 41 | public static void clear() { 42 | org.slf4j.MDC.clear(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/main/java/org/apache/log4j/PatternLayout.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // Contributors: Christian Trutz 18 | package org.apache.log4j; 19 | 20 | /** 21 | * This class is a minimal implementation of the original Log4J class. 22 | * 23 | * @author Christian Trutz 24 | * */ 25 | public class PatternLayout extends Layout { 26 | 27 | public PatternLayout() { 28 | super(); 29 | } 30 | 31 | public PatternLayout(String pattern) { 32 | super(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/main/java/org/apache/log4j/PropertyConfigurator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.log4j; 18 | 19 | import java.net.URL; 20 | import java.util.Properties; 21 | 22 | import org.apache.log4j.spi.Configurator; 23 | import org.apache.log4j.spi.LoggerRepository; 24 | 25 | /** 26 | * An nop implementation of PropertyConfigurator. 27 | */ 28 | public class PropertyConfigurator implements Configurator { 29 | public static void configure(Properties properties) { 30 | } 31 | 32 | public static void configure(String configFilename) { 33 | } 34 | 35 | public static void configure(java.net.URL configURL) { 36 | } 37 | 38 | public static void configureAndWatch(String configFilename) { 39 | } 40 | 41 | public static void configureAndWatch(String configFilename, long delay) { 42 | } 43 | 44 | public void doConfigure(Properties properties, LoggerRepository hierarchy) { 45 | } 46 | 47 | public void doConfigure(String configFileName, LoggerRepository hierarchy) { 48 | } 49 | 50 | public void doConfigure(URL configURL, LoggerRepository hierarchy) { 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/main/java/org/apache/log4j/RollingFileAppender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // Contributors: Christian Trutz 18 | package org.apache.log4j; 19 | 20 | import java.io.IOException; 21 | 22 | /** 23 | * This class is a minimal implementation of the original Log4J class. 24 | * 25 | * @author Christian Trutz 26 | * */ 27 | public class RollingFileAppender { 28 | 29 | public RollingFileAppender() { 30 | super(); 31 | } 32 | 33 | public RollingFileAppender(Layout layout, String filename) throws IOException { 34 | super(); 35 | } 36 | 37 | public RollingFileAppender(Layout layout, String filename, boolean append) 38 | throws IOException { 39 | super(); 40 | } 41 | 42 | public void setMaxBackupIndex(int maxBackups) { 43 | // nothing to do 44 | } 45 | 46 | public void setMaximumFileSize(long maxFileSize) { 47 | // nothing to do 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/main/java/org/apache/log4j/helpers/NullEnumeration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.log4j.helpers; 19 | 20 | import java.util.Enumeration; 21 | import java.util.NoSuchElementException; 22 | 23 | /** 24 | * An always-empty Enumerator. 25 | * 26 | * @author Anders Kristensen 27 | * @since version 1.0 28 | */ 29 | public class NullEnumeration implements Enumeration { 30 | private static final NullEnumeration instance = new NullEnumeration(); 31 | 32 | private NullEnumeration() { 33 | } 34 | 35 | public static NullEnumeration getInstance() { 36 | return instance; 37 | } 38 | 39 | public boolean hasMoreElements() { 40 | return false; 41 | } 42 | 43 | public Object nextElement() { 44 | throw new NoSuchElementException(); 45 | } 46 | } -------------------------------------------------------------------------------- /log4j-over-slf4j/src/main/java/org/apache/log4j/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

An rather minimal but sufficient implementation redirecting all 13 | calls to a log4j logger to a logback logger.

14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/main/java/org/apache/log4j/spi/Configurator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.log4j.spi; 18 | 19 | 20 | import org.apache.log4j.spi.LoggerRepository; 21 | import java.net.URL; 22 | 23 | /** 24 | Implemented by classes capable of configuring log4j using a URL. 25 | 26 | @since 1.0 27 | @author Anders Kristensen 28 | */ 29 | public interface Configurator { 30 | 31 | /** 32 | Special level value signifying inherited behaviour. The current 33 | value of this string constant is inherited. {@link #NULL} 34 | is a synonym. */ 35 | public static final String INHERITED = "inherited"; 36 | 37 | /** 38 | Special level signifying inherited behaviour, same as {@link 39 | #INHERITED}. The current value of this string constant is 40 | null. */ 41 | public static final String NULL = "null"; 42 | 43 | 44 | 45 | /** 46 | Interpret a resource pointed by a URL and set up log4j accordingly. 47 | 48 | The configuration is done relative to the hierarchy 49 | parameter. 50 | 51 | @param url The URL to parse 52 | @param repository The hierarchy to operation upon. 53 | */ 54 | void doConfigure(URL url, LoggerRepository repository); 55 | } 56 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/main/java/org/apache/log4j/spi/ErrorHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.log4j.spi; 18 | 19 | /** 20 | * Created by IntelliJ IDEA. 21 | * User: ceki 22 | * Date: 19 oct. 2010 23 | * Time: 11:46:24 24 | * To change this template use File | Settings | File Templates. 25 | */ 26 | public class ErrorHandler { 27 | } 28 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/main/java/org/apache/log4j/spi/Filter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.log4j.spi; 18 | 19 | public class Filter { 20 | } 21 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/main/java/org/apache/log4j/spi/HierarchyEventListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.log4j.spi; 18 | 19 | import org.apache.log4j.*; 20 | 21 | /** 22 | Listen to events occuring within a {@link 23 | org.apache.log4j.Hierarchy Hierarchy}. 24 | 25 | @author Ceki Gülcü 26 | @since 1.2 27 | 28 | */ 29 | public interface HierarchyEventListener { 30 | 31 | 32 | //public 33 | //void categoryCreationEvent(Category cat); 34 | 35 | 36 | public 37 | void addAppenderEvent(Category cat, Appender appender); 38 | 39 | public 40 | void removeAppenderEvent(Category cat, Appender appender); 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/main/java/org/apache/log4j/spi/Layout.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.log4j.spi; 18 | 19 | public class Layout { 20 | } 21 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/main/java/org/apache/log4j/spi/LoggerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.log4j.spi; 18 | 19 | import org.apache.log4j.Logger; 20 | 21 | /** 22 | 23 | Implement this interface to create new instances of Logger or 24 | a sub-class of Logger. 25 | 26 |

See examples/subclass/MyLogger.java for an example. 27 | 28 | @author Ceki Gülcü 29 | @since version 0.8.5 30 | 31 | */ 32 | public interface LoggerFactory { 33 | 34 | public 35 | Logger makeNewLoggerInstance(String name); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/main/java/org/apache/log4j/spi/LoggingEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.log4j.spi; 18 | 19 | public class LoggingEvent { 20 | } 21 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/main/java/org/apache/log4j/xml/DOMConfigurator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.log4j.xml; 18 | 19 | import org.apache.log4j.spi.Configurator; 20 | import org.apache.log4j.spi.LoggerRepository; 21 | 22 | import javax.xml.parsers.FactoryConfigurationError; 23 | import java.io.InputStream; 24 | import java.io.Reader; 25 | import java.net.URL; 26 | import java.util.Properties; 27 | 28 | 29 | import org.w3c.dom.Element; 30 | 31 | public class DOMConfigurator implements Configurator { 32 | 33 | public static void configure(Element element) { 34 | } 35 | 36 | public static void configure(String filename) throws FactoryConfigurationError { 37 | } 38 | 39 | static public void configure(URL url) throws FactoryConfigurationError { 40 | } 41 | 42 | static public void configureAndWatch(String configFilename) { 43 | } 44 | 45 | public static void configureAndWatch(String configFilename, long delay) { 46 | } 47 | 48 | public void doConfigure(Element element, LoggerRepository repository) { 49 | } 50 | 51 | public void doConfigure(InputStream inputStream, LoggerRepository repository) throws FactoryConfigurationError { 52 | } 53 | 54 | public void doConfigure(Reader reader, LoggerRepository repository) throws FactoryConfigurationError { 55 | } 56 | 57 | public void doConfigure(String filename, LoggerRepository repository) { 58 | } 59 | 60 | public void doConfigure(URL url, LoggerRepository repository) { 61 | } 62 | 63 | public static String subst(String value, Properties props) { 64 | return value; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Implementation-Title: log4j-over-slf4j 2 | Bundle-SymbolicName: log4j.over.slf4j 3 | Bundle-Name: log4j-over-slf4j 4 | Bundle-Vendor: SLF4J.ORG 5 | Export-Package: org.apache.log4j;version=${log4j.version},org.apache.log4j.helpers;version=${log4j.version},org.apache.log4j.spi;version=${log4j.version},org.apache.log4j.xml;version=${log4j.version} 6 | Import-Package: org.slf4j;version=${slf4j.api.minimum.compatible.version}, org.slf4j.helpers;version=${slf4j.api.minimum.compatible.version}, org.slf4j.spi;version=${slf4j.api.minimum.compatible.version} 7 | 8 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/test/java/org/apache/log4j/NDCTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.apache.log4j; 26 | 27 | import junit.framework.TestCase; 28 | 29 | /** 30 | * @author Ceki Gücü 31 | */ 32 | public class NDCTest extends TestCase { 33 | 34 | 35 | public void setUp() { 36 | assertEquals(0, NDC.getDepth()); 37 | } 38 | 39 | public void tearDown() { 40 | NDC.clear(); 41 | } 42 | 43 | public void testSmoke() { 44 | NDC.push("a"); 45 | String back = NDC.pop(); 46 | assertEquals("a", back); 47 | } 48 | 49 | public void testPop() { 50 | NDC.push("peek"); 51 | String back = NDC.peek(); 52 | assertEquals("peek", back); 53 | } 54 | 55 | public void testClear() { 56 | NDC.push("clear"); 57 | NDC.clear(); 58 | assertEquals(0, NDC.getDepth()); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/test/java/org/apache/log4j/Trivial.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.apache.log4j; 26 | 27 | import org.apache.log4j.Logger; 28 | 29 | import junit.framework.TestCase; 30 | 31 | public class Trivial extends TestCase { 32 | 33 | public void testSmoke() { 34 | Logger l = Logger.getLogger("a"); 35 | l.trace("t"); 36 | l.debug("d"); 37 | l.info("i"); 38 | l.warn("w"); 39 | l.error("e"); 40 | l.fatal("f"); 41 | 42 | Exception e = new Exception("testing"); 43 | l.trace("t", e); 44 | l.debug("d", e); 45 | l.info("i", e); 46 | l.warn("w", e); 47 | l.error("e", e); 48 | l.fatal("f", e); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/test/java/org/dummy/Bug139.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.dummy; 26 | 27 | import java.util.logging.Level; 28 | import java.util.logging.LogRecord; 29 | 30 | import junit.framework.TestCase; 31 | 32 | import org.apache.log4j.Category; 33 | import org.apache.log4j.Logger; 34 | 35 | public class Bug139 extends TestCase { 36 | 37 | public void test() { 38 | ListHandler listHandler = new ListHandler(); 39 | java.util.logging.Logger root = java.util.logging.Logger.getLogger(""); 40 | root.addHandler(listHandler); 41 | root.setLevel(Level.FINEST); 42 | Logger log4jLogger = Logger.getLogger("a"); 43 | Category log4jCategory = Logger.getLogger("b"); 44 | 45 | int n = 0; 46 | 47 | log4jLogger.log(org.apache.log4j.Level.DEBUG, "hello"+(++n)); 48 | log4jCategory.log(org.apache.log4j.Level.DEBUG, "world"+(++n)); 49 | 50 | assertEquals(n, listHandler.list.size()); 51 | 52 | for (int i = 0; i < n; i++) { 53 | LogRecord logRecord = (LogRecord) listHandler.list.get(i); 54 | assertEquals("test", logRecord.getSourceMethodName()); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /log4j-over-slf4j/src/test/java/org/dummy/ListHandler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.dummy; 26 | 27 | import java.util.ArrayList; 28 | import java.util.List; 29 | import java.util.logging.Handler; 30 | import java.util.logging.LogRecord; 31 | 32 | public class ListHandler extends Handler { 33 | 34 | List list = new ArrayList(); 35 | 36 | public void close() throws SecurityException { 37 | 38 | } 39 | 40 | public void flush() { 41 | 42 | } 43 | 44 | public void publish(LogRecord logRecord) { 45 | logRecord.getSourceClassName(); 46 | list.add(logRecord); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /osgi-over-slf4j/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | org.slf4j 5 | slf4j-parent 6 | 1.7.5 7 | 8 | 9 | 4.0.0 10 | 11 | org.slf4j 12 | osgi-over-slf4j 13 | bundle 14 | OSGi LogService implemented over SLF4J 15 | 16 | http://www.slf4j.org 17 | 18 | OSGi LogService implementation over SLF4J 19 | 20 | 21 | 22 | 23 | org.osgi 24 | org.osgi.core 25 | 4.2.0 26 | provided 27 | 28 | 29 | org.osgi 30 | org.osgi.enterprise 31 | 4.2.0 32 | provided 33 | 34 | 35 | 36 | org.slf4j 37 | slf4j-simple 38 | ${project.version} 39 | provided 40 | 41 | 42 | 43 | 44 | 45 | org.apache.felix 46 | maven-bundle-plugin 47 | 2.3.7 48 | true 49 | 50 | 51 | org.osgi.service.log 52 | org.slf4j.osgi.logservice.impl.Activator 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /slf4j-android/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /.settings 3 | /.classpath 4 | /.project 5 | /gen 6 | /bin 7 | -------------------------------------------------------------------------------- /slf4j-android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /slf4j-android/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | android.library=true 11 | # Project target. 12 | target=android-3 13 | apk-configurations= 14 | -------------------------------------------------------------------------------- /slf4j-android/src/main/java/org/slf4j/impl/StaticMDCBinder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Created 21.10.2009 3 | * 4 | * Copyright (c) 2009-2012 SLF4J.ORG 5 | * 6 | * All rights reserved. 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining 9 | * a copy of this software and associated documentation files (the 10 | * "Software"), to deal in the Software without restriction, including 11 | * without limitation the rights to use, copy, modify, merge, publish, 12 | * distribute, sublicense, and/or sell copies of the Software, and to 13 | * permit persons to whom the Software is furnished to do so, subject to 14 | * the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 23 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 24 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 25 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | package org.slf4j.impl; 28 | 29 | import org.slf4j.helpers.NOPMDCAdapter; 30 | import org.slf4j.spi.MDCAdapter; 31 | 32 | /** 33 | * This implementation is bound to {@link NOPMDCAdapter}. 34 | * 35 | * @author Ceki Gülcü 36 | * @author Thorsten Möler 37 | */ 38 | public class StaticMDCBinder 39 | { 40 | 41 | /** 42 | * The unique instance of this class. 43 | */ 44 | public static final StaticMDCBinder SINGLETON = new StaticMDCBinder(); 45 | 46 | private StaticMDCBinder() 47 | { 48 | } 49 | 50 | /** 51 | * Currently this method always returns an instance of 52 | * {@link StaticMDCBinder}. 53 | */ 54 | public MDCAdapter getMDCA() 55 | { 56 | return new NOPMDCAdapter(); 57 | } 58 | 59 | public String getMDCAdapterClassStr() 60 | { 61 | return NOPMDCAdapter.class.getName(); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /slf4j-api/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2007 QOS.ch 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /slf4j-api/src/main/java/org/slf4j/helpers/NOPLoggerFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.helpers; 26 | 27 | import org.slf4j.ILoggerFactory; 28 | import org.slf4j.Logger; 29 | import org.slf4j.helpers.NOPLogger; 30 | 31 | 32 | /** 33 | * NOPLoggerFactory is an trivial implementation of {@link 34 | * ILoggerFactory} which always returns the unique instance of 35 | * NOPLogger. 36 | * 37 | * @author Ceki Gülcü 38 | */ 39 | public class NOPLoggerFactory implements ILoggerFactory { 40 | 41 | public NOPLoggerFactory() { 42 | // nothing to do 43 | } 44 | 45 | public Logger getLogger(String name) { 46 | return NOPLogger.NOP_LOGGER; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /slf4j-api/src/main/java/org/slf4j/helpers/NOPMDCAdapter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.helpers; 26 | 27 | import java.util.Map; 28 | 29 | import org.slf4j.spi.MDCAdapter; 30 | 31 | /** 32 | * This adapter is an empty implementation of the {@link MDCAdapter} interface. 33 | * It is used for all logging systems which do not support mapped 34 | * diagnostic contexts such as JDK14, simple and NOP. 35 | * 36 | * @author Ceki Gülcü 37 | * 38 | * @since 1.4.1 39 | */ 40 | public class NOPMDCAdapter implements MDCAdapter { 41 | 42 | public void clear() { 43 | } 44 | 45 | public String get(String key) { 46 | return null; 47 | } 48 | 49 | public void put(String key, String val) { 50 | } 51 | 52 | public void remove(String key) { 53 | } 54 | 55 | public Map getCopyOfContextMap() { 56 | return null; 57 | } 58 | 59 | public void setContextMap(Map contextMap) { 60 | // NOP 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /slf4j-api/src/main/java/org/slf4j/helpers/Util.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.helpers; 26 | 27 | 28 | /** 29 | * 30 | * An internal utility class. 31 | * 32 | * @author Ceki Gülcü 33 | */ 34 | public class Util { 35 | 36 | static final public void report(String msg, Throwable t) { 37 | System.err.println(msg); 38 | System.err.println("Reported exception:"); 39 | t.printStackTrace(); 40 | } 41 | 42 | static final public void report(String msg) { 43 | System.err.println("SLF4J: " +msg); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /slf4j-api/src/main/java/org/slf4j/helpers/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

Helper classes.

13 | 14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /slf4j-api/src/main/java/org/slf4j/impl/StaticMDCBinder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.impl; 26 | 27 | import org.slf4j.spi.MDCAdapter; 28 | 29 | 30 | /** 31 | * This class is only a stub. Real implementations are found in 32 | * each SLF4J binding project, e.g. slf4j-nop, slf4j-log4j12 etc. 33 | * 34 | * @author Ceki Gülcü 35 | */ 36 | public class StaticMDCBinder { 37 | 38 | 39 | /** 40 | * The unique instance of this class. 41 | */ 42 | public static final StaticMDCBinder SINGLETON = new StaticMDCBinder(); 43 | 44 | private StaticMDCBinder() { 45 | throw new UnsupportedOperationException("This code should never make it into the jar"); 46 | } 47 | 48 | /** 49 | * Currently this method always returns an instance of 50 | * {@link StaticMDCBinder}. 51 | */ 52 | public MDCAdapter getMDCA() { 53 | throw new UnsupportedOperationException("This code should never make it into the jar"); 54 | } 55 | 56 | public String getMDCAdapterClassStr() { 57 | throw new UnsupportedOperationException("This code should never make it into the jar"); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /slf4j-api/src/main/java/org/slf4j/impl/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

Implementations of core logging interfaces defined in the {@link 13 | org.slf4j} package.

14 | 15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /slf4j-api/src/main/java/org/slf4j/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

Core logging interfaces.

13 | 14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /slf4j-api/src/main/java/org/slf4j/spi/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Classes and interfaces which are internal to SLF4J. Under most 6 | circumstances SLF4J users should be oblivious even to the existence of 7 | this package. 8 | -------------------------------------------------------------------------------- /slf4j-api/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Implementation-Title: slf4j-api 2 | Bundle-ManifestVersion: 2 3 | Bundle-SymbolicName: slf4j.api 4 | Bundle-Name: slf4j-api 5 | Bundle-Vendor: SLF4J.ORG 6 | Bundle-RequiredExecutionEnvironment: J2SE-1.3 7 | Export-Package: org.slf4j;version=${parsedVersion.osgiVersion}, org.slf4j.spi;version=${parsedVersion.osgiVersion}, org.slf4j.helpers;version=${parsedVersion.osgiVersion} 8 | Import-Package: org.slf4j.impl;version=${slf4j.api.minimum.compatible.version} 9 | -------------------------------------------------------------------------------- /slf4j-api/src/test/java/org/slf4j/Differentiator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | 26 | package org.slf4j; 27 | 28 | import java.util.Random; 29 | 30 | public class Differentiator { 31 | 32 | static Random random = new Random(System.currentTimeMillis()); 33 | 34 | static public short getDiffentiator() { 35 | return (short) random.nextInt(Short.MAX_VALUE); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /slf4j-api/src/test/java/org/slf4j/NoBindingTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j; 26 | 27 | import java.util.Random; 28 | 29 | import org.slf4j.helpers.BasicMarker; 30 | import org.slf4j.helpers.NOPLogger; 31 | 32 | import junit.framework.TestCase; 33 | 34 | public class NoBindingTest extends TestCase { 35 | 36 | int diff = new Random().nextInt(10000); 37 | 38 | public void testLogger() { 39 | Logger logger = LoggerFactory.getLogger(NoBindingTest.class); 40 | logger.debug("hello"+diff); 41 | assertTrue(logger instanceof NOPLogger); 42 | } 43 | 44 | public void testMDC() { 45 | MDC.put("k"+diff, "v"); 46 | assertNull(MDC.get("k")); 47 | } 48 | 49 | public void testMarker() { 50 | Marker m = MarkerFactory.getMarker("a"+diff); 51 | assertTrue(m instanceof BasicMarker); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /slf4j-api/src/test/java/org/slf4j/helpers/BubbleSort.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.helpers; 26 | 27 | /** 28 | * This class is used internally by BogoPerf, hence the package private 29 | * (default) access. 30 | * 31 | * @author Ceki 32 | */ 33 | class BubbleSort { 34 | 35 | static void sort(int[] a) { 36 | int len = a.length; 37 | for (int i = 0; i < len - 1; i++) { 38 | for (int j = 0; j < len - 1 - i; j++) { 39 | if (a[j] > a[j + 1]) { 40 | swap(a, j, j + 1); 41 | } 42 | } 43 | } 44 | } 45 | static void swap(int[] a, int i, int j) { 46 | int t = a[i]; 47 | a[i] = a[j]; 48 | a[j] = t; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /slf4j-api/src/test/java/org/slf4j/helpers/MyRandom.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.helpers; 26 | 27 | 28 | class MyRandom { 29 | 30 | private static final long serialVersionUID = -907426287094698288L; 31 | 32 | private final static long m = 200000000041L; // a prime number 33 | private final static long a = 2000000011L; // a prime number 34 | 35 | long y; 36 | long unused; 37 | int bits = 32; 38 | 39 | public MyRandom() { 40 | this(System.nanoTime()); 41 | } 42 | 43 | 44 | public MyRandom(long seed) { 45 | this.y = seed; 46 | } 47 | 48 | 49 | int nextInt() { 50 | // we don't really care about the randomness of this 51 | // generator 52 | y = (a*y + 1) % m; 53 | unused = y >>> (48-bits); // just exercise the >>> operator 54 | return (int)(y); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /slf4j-ext/src/main/java/org/slf4j/NDC.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j; 26 | 27 | import org.slf4j.MDC; 28 | 29 | public class NDC { 30 | public final static String PREFIX = "NDC"; 31 | 32 | private static int size() { 33 | int i = 0; 34 | while (true) { 35 | String val = MDC.get(PREFIX + i); 36 | if (val != null) { 37 | i++; 38 | } else { 39 | break; 40 | } 41 | } 42 | return i; 43 | } 44 | 45 | public static void push(String val) { 46 | int next = size(); 47 | MDC.put(PREFIX + next, val); 48 | } 49 | 50 | public static String pop() { 51 | int next = size(); 52 | if(next == 0) { 53 | return ""; 54 | } 55 | int last = next-1; 56 | String key = PREFIX+last; 57 | String val = MDC.get(key); 58 | MDC.remove(key); 59 | return val; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /slf4j-ext/src/main/java/org/slf4j/agent/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |

"-javaagent" routines for SLF4J.

11 |

The "-javaagent" flag provided in Java 5+ allows for writing 12 | agents in Java, which previously was possible in native code only. The 13 | full details are available at http://java.sun.com/javase/6/docs/api/java/lang/instrument/package-summary.html. 15 | 16 | 17 | Please notice that code made available to the java agent is also 18 | available to the actual program executed.

19 |

The slf4j-ext-X.Y.Z.jar file provides such a java agent, which is 20 | implemented in AgentPremain.java. It is used by adding a -javaagent flag to the Java command line: 21 | 22 | E.g. 23 |

java HelloWorld
24 | is changed to 25 |
java -javaagent:/path/to/slf4j-ext-X.Y.Z.jar=OPTIONS HelloWorld
26 | 27 | What is actually done, depends on the OPTIONS passed to the agent. These are listed in AgentOptions.java. 28 |

29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /slf4j-ext/src/main/java/org/slf4j/cal10n/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |

SLF4J API extensions

11 | 12 | 13 | -------------------------------------------------------------------------------- /slf4j-ext/src/main/java/org/slf4j/ext/MDCStrLookup.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.ext; 26 | 27 | import org.apache.commons.lang.text.StrLookup; 28 | import org.slf4j.MDC; 29 | 30 | 31 | /** 32 | * This class can be used with the Commons Lang StrSubstitutor to replace 33 | * tokens that occur in Strings with their values in the MDC. 34 | * 35 | * @author Ralph Goers 36 | */ 37 | public class MDCStrLookup extends StrLookup { 38 | /** 39 | * Looks up up a value in the MDC. 40 | * 41 | * @param key the key to be looked up, may be null 42 | * @return the matching value, null if no match 43 | */ 44 | public String lookup(String key) { 45 | if (key == null) { 46 | return null; 47 | } 48 | return MDC.get(key); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /slf4j-ext/src/main/java/org/slf4j/ext/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |

Localized logging using the CAL10N API.

11 | 12 | 13 | -------------------------------------------------------------------------------- /slf4j-ext/src/main/java/org/slf4j/instrumentation/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |

Java instrumentation routines for SLF4J.

11 | 12 |

Byte code instrumentation is an way to change behaviour of java 13 | classes at load time. This is done in-between the original byte 14 | codes are retrieved and the class object is constructed by the class 15 | loader. Currently this depends on the javassist library from JBoss 16 | (which in turn uses it extensively in their application server).

17 | 18 | 19 | -------------------------------------------------------------------------------- /slf4j-ext/src/main/java/org/slf4j/profiler/DurationUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.profiler; 26 | 27 | /** 28 | * An enum of supported time units. 29 | * 30 | * @author Ceki 31 | * 32 | */ 33 | public enum DurationUnit { 34 | NANOSECOND, MICROSECOND, MILLISSECOND, SECOND; 35 | } -------------------------------------------------------------------------------- /slf4j-ext/src/main/java/org/slf4j/profiler/TimeInstrumentStatus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | 26 | 27 | /** 28 | * A StopWatch can be in two states: STARTED or STOPPED. 29 | */ 30 | 31 | package org.slf4j.profiler; 32 | 33 | /** 34 | * A time instrument can be in STARTED or STOPPED status. 35 | * 36 | * @author Ceki Gülcü 37 | * 38 | */ 39 | enum TimeInstrumentStatus { 40 | STARTED, STOPPED; 41 | } -------------------------------------------------------------------------------- /slf4j-ext/src/main/java/org/slf4j/profiler/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |

Poor man's profiler API

12 | 13 | 14 | -------------------------------------------------------------------------------- /slf4j-ext/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Implementation-Title: slf4j-ext 2 | Bundle-ManifestVersion: 2 3 | Bundle-SymbolicName: slf4j.ext 4 | Bundle-Name: slf4j-ext 5 | Bundle-Vendor: SLF4J.ORG 6 | Bundle-RequiredExecutionEnvironment: J2SE-1.5 7 | Export-Package: org.slf4j.profiler;version=${parsedVersion.osgiVersion}, org.slf4j.cal10n;version=${parsedVersion.osgiVersion}, org.slf4j.ext;version=${parsedVersion.osgiVersion} 8 | Import-Package: org.slf4j;version=${parsedVersion.osgiVersion}, org.slf4j.spi;version=${parsedVersion.osgiVersion}, org.slf4j.helpers;version=${parsedVersion.osgiVersion}, ch.qos.cal10n;version=${cal10n.version} 9 | -------------------------------------------------------------------------------- /slf4j-ext/src/test/java/org/slf4j/NDCTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j; 26 | 27 | import junit.framework.TestCase; 28 | 29 | public class NDCTest extends TestCase { 30 | 31 | protected void setUp() throws Exception { 32 | super.setUp(); 33 | MDC.clear(); 34 | } 35 | 36 | protected void tearDown() throws Exception { 37 | super.tearDown(); 38 | } 39 | 40 | public void testEmpty() { 41 | assertEquals("", NDC.pop()); 42 | } 43 | 44 | public void testSmoke() { 45 | NDC.push("a"); 46 | String result = NDC.pop(); 47 | assertEquals("a",result); 48 | } 49 | 50 | public void testSmoke2() { 51 | NDC.push("a"); 52 | NDC.push("b"); 53 | String result1 = NDC.pop(); 54 | String result0 = NDC.pop(); 55 | assertEquals("b",result1); 56 | assertEquals("a",result0); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/Months.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.cal10n_dummy; 26 | 27 | import ch.qos.cal10n.BaseName; 28 | 29 | @BaseName("months") 30 | public enum Months { 31 | 32 | JAN, FEB, MAR, APR, MAY, JUN; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/MyApplication.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.cal10n_dummy; 26 | 27 | import java.util.Locale; 28 | 29 | import org.slf4j.cal10n.LocLogger; 30 | import org.slf4j.cal10n.LocLoggerFactory; 31 | 32 | import ch.qos.cal10n.IMessageConveyor; 33 | import ch.qos.cal10n.MessageConveyor; 34 | 35 | public class MyApplication { 36 | 37 | // create a message conveyor for a given locale 38 | IMessageConveyor messageConveyor = new MessageConveyor(Locale.JAPAN); 39 | 40 | // create the LogLoggerFactory 41 | LocLoggerFactory llFactory_uk = new LocLoggerFactory(messageConveyor); 42 | 43 | // create a locLogger 44 | LocLogger locLogger = llFactory_uk.getLocLogger(this.getClass()); 45 | 46 | 47 | public void applicationStart() { 48 | locLogger.info(Production.APPLICATION_STARTED); 49 | // .. 50 | } 51 | 52 | public void applicationStop() { 53 | locLogger.info(Production.APPLICATION_STOPPED); 54 | // ... 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/PackageTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.cal10n_dummy; 26 | 27 | import junit.framework.*; 28 | 29 | public class PackageTest extends TestCase { 30 | 31 | public static Test suite() { 32 | TestSuite suite = new TestSuite(); 33 | suite.addTestSuite(LocLoggerTest.class); 34 | return suite; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/Production.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.cal10n_dummy; 26 | 27 | import ch.qos.cal10n.LocaleData; 28 | import ch.qos.cal10n.Locale; 29 | import ch.qos.cal10n.BaseName; 30 | 31 | @BaseName("production") 32 | @LocaleData( { @Locale("en_UK"), @Locale("fr") }) 33 | public enum Production { 34 | APPLICATION_STARTED, 35 | APPLICATION_STOPPED, 36 | DB_CONNECTION, 37 | DB_CONNECTION_FAILURE; 38 | } -------------------------------------------------------------------------------- /slf4j-ext/src/test/java/org/slf4j/dummyExt/ListAppender.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.dummyExt; 26 | 27 | import java.util.ArrayList; 28 | import java.util.List; 29 | 30 | import org.apache.log4j.AppenderSkeleton; 31 | import org.apache.log4j.spi.LoggingEvent; 32 | 33 | public class ListAppender extends AppenderSkeleton { 34 | 35 | public List list = new ArrayList(); 36 | 37 | public boolean extractLocationInfo = false; 38 | 39 | protected void append(LoggingEvent event) { 40 | list.add(event); 41 | if(extractLocationInfo) { 42 | event.getLocationInformation(); 43 | } 44 | } 45 | 46 | public void close() { 47 | } 48 | 49 | public boolean requiresLayout() { 50 | return false; 51 | } 52 | 53 | } 54 | 55 | -------------------------------------------------------------------------------- /slf4j-ext/src/test/java/org/slf4j/dummyExt/MDCStrLookupTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.dummyExt; 26 | 27 | import junit.framework.TestCase; 28 | 29 | import org.slf4j.MDC; 30 | import org.slf4j.ext.MDCStrLookup; 31 | 32 | public class MDCStrLookupTest extends TestCase { 33 | 34 | 35 | public MDCStrLookupTest(String name) { 36 | super(name); 37 | } 38 | 39 | public void setUp() throws Exception { 40 | super.setUp(); 41 | } 42 | 43 | public void tearDown() throws Exception { 44 | super.tearDown(); 45 | } 46 | 47 | public void testLookup() throws Exception { 48 | MDC.put("key", "value"); 49 | MDC.put("number", "2"); 50 | MDCStrLookup lookup = new MDCStrLookup(); 51 | assertEquals("value", lookup.lookup("key")); 52 | assertEquals("2", lookup.lookup("number")); 53 | assertEquals(null, lookup.lookup(null)); 54 | assertEquals(null, lookup.lookup("")); 55 | assertEquals(null, lookup.lookup("other")); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /slf4j-ext/src/test/java/org/slf4j/dummyExt/PackageTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.dummyExt; 26 | 27 | import junit.framework.*; 28 | 29 | public class PackageTest extends TestCase { 30 | 31 | public static Test suite() { 32 | TestSuite suite = new TestSuite(); 33 | suite.addTestSuite(MDCStrLookupTest.class); 34 | suite.addTestSuite(XLoggerTest.class); 35 | suite.addTestSuite(EventLoggerTest.class); 36 | return suite; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /slf4j-ext/src/test/java/org/slf4j/dummyExt/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Tests related to the org.slfj.ext package. However, location information code 4 | required the caller class (XLogger) to have a different prefix than 5 | the test class XLoggerTest. This is ensured by having the test class 6 | placed in a different package. 7 | 8 | -------------------------------------------------------------------------------- /slf4j-ext/src/test/java/org/slf4j/profiler/PackageTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.profiler; 26 | 27 | 28 | import junit.framework.*; 29 | 30 | public class PackageTest extends TestCase { 31 | 32 | public static Test suite() { 33 | TestSuite suite = new TestSuite(); 34 | suite.addTestSuite(UtilTest.class); 35 | suite.addTestSuite(ProfilerTest.class); 36 | return suite; 37 | } 38 | } -------------------------------------------------------------------------------- /slf4j-ext/src/test/java/org/slf4j/profiler/RandomIntegerArrayGenerator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.profiler; 26 | 27 | import java.util.Random; 28 | 29 | public class RandomIntegerArrayGenerator { 30 | Random rand = new Random(11); 31 | 32 | int[] generate(int size) { 33 | int[] result = new int[size]; 34 | for(int i = 0; i < size; i++) { 35 | int r = rand.nextInt(); 36 | result[i] = r; 37 | } 38 | return result; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /slf4j-ext/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | 2 | log4j.rootLogger=DEBUG, CONSOLE 3 | 4 | log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender 5 | log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n 7 | -------------------------------------------------------------------------------- /slf4j-ext/src/test/resources/months_en.properties: -------------------------------------------------------------------------------- 1 | JAN=January 2 | FEB=February 3 | MAR=March 4 | APR=April 5 | MAY=May 6 | JUN=June 7 | -------------------------------------------------------------------------------- /slf4j-jcl/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2007 QOS.ch 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /slf4j-jcl/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | org.slf4j 5 | slf4j-parent 6 | 1.7.5 7 | 8 | 9 | 4.0.0 10 | 11 | org.slf4j 12 | slf4j-jcl 13 | jar 14 | SLF4J JCL Binding 15 | SLF4J JCL Binding 16 | 17 | http://www.slf4j.org 18 | 19 | 20 | 21 | 22 | org.slf4j 23 | slf4j-api 24 | 25 | 26 | 27 | commons-logging 28 | commons-logging 29 | 1.1.1 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | org.apache.maven.plugins 38 | maven-jar-plugin 39 | 40 | 41 | 42 | ${parsedVersion.osgiVersion} 43 | ${project.description} 44 | ${project.version} 45 | 46 | ${project.build.outputDirectory}/META-INF/MANIFEST.MF 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /slf4j-jcl/src/main/java/org/slf4j/impl/StaticMDCBinder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.impl; 26 | 27 | import org.slf4j.helpers.NOPMDCAdapter; 28 | import org.slf4j.spi.MDCAdapter; 29 | 30 | 31 | /** 32 | * This implementation is bound to {@link NOPMDCAdapter}. 33 | * 34 | * @author Ceki Gülcü 35 | */ 36 | public class StaticMDCBinder { 37 | 38 | 39 | /** 40 | * The unique instance of this class. 41 | */ 42 | public static final StaticMDCBinder SINGLETON = new StaticMDCBinder(); 43 | 44 | private StaticMDCBinder() { 45 | } 46 | 47 | /** 48 | * Currently this method always returns an instance of 49 | * {@link NOPMDCAdapter}. 50 | * 51 | * @return instance of NOPMDCAdapter 52 | */ 53 | public MDCAdapter getMDCA() { 54 | return new NOPMDCAdapter(); 55 | } 56 | 57 | public String getMDCAdapterClassStr() { 58 | return NOPMDCAdapter.class.getName(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /slf4j-jcl/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Implementation-Title: slf4j-jcl 2 | Bundle-ManifestVersion: 2 3 | Bundle-SymbolicName: slf4j.jcl 4 | Bundle-Name: slf4j-jcl 5 | Bundle-Vendor: SLF4J.ORG 6 | Require-Bundle: slf4j.api 7 | Bundle-RequiredExecutionEnvironment: J2SE-1.3 8 | Export-Package: org.slf4j.impl;version=${parsedVersion.osgiVersion} 9 | Import-Package: org.slf4j.spi;version=${parsedVersion.osgiVersion}, org.slf4j.helpers;version=${parsedVersion.osgiVersion}, org.apache.commons.logging 10 | Fragment-Host: slf4j.api -------------------------------------------------------------------------------- /slf4j-jdk14/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2007 QOS.ch 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /slf4j-jdk14/pom.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | org.slf4j 8 | slf4j-parent 9 | 1.7.5 10 | 11 | 12 | 4.0.0 13 | 14 | org.slf4j 15 | slf4j-jdk14 16 | 17 | jar 18 | SLF4J JDK14 Binding 19 | SLF4J JDK14 Binding 20 | http://www.slf4j.org 21 | 22 | 23 | 24 | 25 | org.slf4j 26 | slf4j-api 27 | 28 | 29 | 30 | org.slf4j 31 | slf4j-api 32 | test-jar 33 | ${project.version} 34 | test 35 | 36 | 37 | 38 | 39 | 40 | 41 | org.apache.maven.plugins 42 | maven-jar-plugin 43 | 44 | 45 | 46 | ${parsedVersion.osgiVersion} 47 | ${project.description} 48 | ${project.version} 49 | 50 | ${project.build.outputDirectory}/META-INF/MANIFEST.MF 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /slf4j-jdk14/src/main/java/org/slf4j/impl/StaticMDCBinder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.impl; 26 | 27 | import org.slf4j.helpers.BasicMDCAdapter; 28 | import org.slf4j.spi.MDCAdapter; 29 | 30 | 31 | /** 32 | * This implementation is bound to {@link BasicMDCAdapter}. 33 | * 34 | * @author Ceki Gülcü 35 | */ 36 | public class StaticMDCBinder { 37 | 38 | 39 | /** 40 | * The unique instance of this class. 41 | */ 42 | public static final StaticMDCBinder SINGLETON = new StaticMDCBinder(); 43 | 44 | private StaticMDCBinder() { 45 | } 46 | 47 | /** 48 | * Currently this method always returns an instance of 49 | * {@link BasicMDCAdapter}. 50 | */ 51 | public MDCAdapter getMDCA() { 52 | // note that this method is invoked only from within the static initializer of 53 | // the org.slf4j.MDC class. 54 | return new BasicMDCAdapter(); 55 | } 56 | 57 | public String getMDCAdapterClassStr() { 58 | return BasicMDCAdapter.class.getName(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /slf4j-jdk14/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Implementation-Title: slf4j-jdk14 2 | Bundle-ManifestVersion: 2 3 | Bundle-SymbolicName: slf4j.jdk14 4 | Bundle-Name: slf4j-jdk14 5 | Bundle-Vendor: SLF4J.ORG 6 | Bundle-RequiredExecutionEnvironment: J2SE-1.3 7 | Export-Package: org.slf4j.impl;version=${parsedVersion.osgiVersion} 8 | Import-Package: org.slf4j;version=${parsedVersion.osgiVersion}, org.slf4j.spi;version=${parsedVersion.osgiVersion}, org.slf4j.helpers;version=${parsedVersion.osgiVersion} 9 | Fragment-Host: slf4j.api -------------------------------------------------------------------------------- /slf4j-log4j12/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2007 QOS.ch 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /slf4j-log4j12/pom.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | org.slf4j 8 | slf4j-parent 9 | 1.7.5 10 | 11 | 12 | 4.0.0 13 | 14 | org.slf4j 15 | slf4j-log4j12 16 | jar 17 | SLF4J LOG4J-12 Binding 18 | SLF4J LOG4J-12 Binding 19 | http://www.slf4j.org 20 | 21 | 22 | 23 | 24 | org.slf4j 25 | slf4j-api 26 | 27 | 28 | 29 | log4j 30 | log4j 31 | 32 | 33 | 34 | 35 | 36 | 37 | org.apache.maven.plugins 38 | maven-jar-plugin 39 | 40 | 41 | 42 | ${parsedVersion.osgiVersion} 43 | ${project.description} 44 | ${project.version} 45 | 46 | ${project.build.outputDirectory}/META-INF/MANIFEST.MF 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /slf4j-log4j12/src/main/java/org/slf4j/impl/StaticMDCBinder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.impl; 26 | 27 | import org.slf4j.spi.MDCAdapter; 28 | 29 | 30 | /** 31 | * This implementation is bound to {@link Log4jMDCAdapter}. 32 | * 33 | * @author Ceki Gülcü 34 | */ 35 | public class StaticMDCBinder { 36 | 37 | 38 | /** 39 | * The unique instance of this class. 40 | */ 41 | public static final StaticMDCBinder SINGLETON = new StaticMDCBinder(); 42 | 43 | private StaticMDCBinder() { 44 | } 45 | 46 | /** 47 | * Currently this method always returns an instance of 48 | * {@link StaticMDCBinder}. 49 | */ 50 | public MDCAdapter getMDCA() { 51 | return new Log4jMDCAdapter(); 52 | } 53 | 54 | public String getMDCAdapterClassStr() { 55 | return Log4jMDCAdapter.class.getName(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /slf4j-log4j12/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Implementation-Title: slf4j-log4j12 2 | Bundle-ManifestVersion: 2 3 | Bundle-SymbolicName: slf4j.log4j12 4 | Bundle-Name: slf4j-log4j12 5 | Bundle-Vendor: SLF4J.ORG 6 | Bundle-RequiredExecutionEnvironment: J2SE-1.3 7 | Export-Package: org.slf4j.impl;version=${parsedVersion.osgiVersion} 8 | Import-Package: org.slf4j;version=${parsedVersion.osgiVersion}, org.slf4j.spi;version=${parsedVersion.osgiVersion}, org.slf4j.helpers;version=${parsedVersion.osgiVersion}, org.apache.log4j 9 | Fragment-Host: slf4j.api -------------------------------------------------------------------------------- /slf4j-log4j12/src/test/java/org/slf4j/ListAppender.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j; 26 | 27 | import java.util.ArrayList; 28 | import java.util.List; 29 | 30 | import org.apache.log4j.AppenderSkeleton; 31 | import org.apache.log4j.spi.LoggingEvent; 32 | 33 | public class ListAppender extends AppenderSkeleton { 34 | 35 | public List list = new ArrayList(); 36 | 37 | public boolean extractLocationInfo = false; 38 | 39 | protected void append(LoggingEvent event) { 40 | list.add(event); 41 | if(extractLocationInfo) { 42 | event.getLocationInformation(); 43 | } 44 | } 45 | 46 | public void close() { 47 | } 48 | 49 | public boolean requiresLayout() { 50 | return false; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /slf4j-log4j12/src/test/java/org/slf4j/impl/RecursiveAppender.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.impl; 26 | 27 | import java.util.Random; 28 | 29 | import org.apache.log4j.AppenderSkeleton; 30 | import org.apache.log4j.spi.LoggingEvent; 31 | import org.slf4j.Logger; 32 | import org.slf4j.LoggerFactory; 33 | 34 | public class RecursiveAppender extends AppenderSkeleton { 35 | 36 | int diff = new Random().nextInt(); 37 | 38 | public RecursiveAppender() { 39 | System.out.println("in RecursiveAppender constructor"); 40 | Logger logger = LoggerFactory.getLogger("RecursiveAppender"+diff); 41 | System.out.println("logger class="+logger.getClass().getName()); 42 | logger.info("Calling a logger in the constructor"); 43 | } 44 | 45 | protected void append(LoggingEvent arg0) { 46 | } 47 | 48 | public void close() { 49 | } 50 | 51 | public boolean requiresLayout() { 52 | return false; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /slf4j-log4j12/src/test/java/org/slf4j/impl/RecursiveInitializationTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.impl; 26 | 27 | import java.util.Random; 28 | 29 | import junit.framework.TestCase; 30 | 31 | import org.slf4j.Logger; 32 | import org.slf4j.LoggerFactory; 33 | 34 | public class RecursiveInitializationTest extends TestCase { 35 | 36 | // value of LogManager.DEFAULT_CONFIGURATION_KEY; 37 | static String CONFIG_FILE_KEY = "log4j.configuration"; 38 | 39 | int diff = new Random().nextInt(10000); 40 | 41 | protected void setUp() throws Exception { 42 | System.setProperty(CONFIG_FILE_KEY, "recursiveInit.properties"); 43 | super.setUp(); 44 | } 45 | 46 | protected void tearDown() throws Exception { 47 | System.clearProperty(CONFIG_FILE_KEY); 48 | super.tearDown(); 49 | } 50 | 51 | public void testLog4j() { 52 | Logger logger = LoggerFactory.getLogger("x"+diff); 53 | System.out.println("logger class="+logger.getClass().getName()); 54 | logger.info("hello"); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /slf4j-log4j12/src/test/resources/recursiveInit.properties: -------------------------------------------------------------------------------- 1 | log4j.debug=true 2 | log4j.rootLogger=DEBUG, RECURSIVE 3 | 4 | log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender 5 | log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.CONSOLE.layout.ConversionPattern=%d [%t] %c - %m%n 7 | 8 | log4j.appender.RECURSIVE=org.slf4j.impl.RecursiveAppender -------------------------------------------------------------------------------- /slf4j-migrator/LIMITATIONS.txt: -------------------------------------------------------------------------------- 1 | 2 | The slf4j-migrator aims to 3 | 4 | General limitations 5 | =================== 6 | 7 | - the FATAL level is not supported. 8 | 9 | This is limitation is not deemed serious because there are usually 10 | very few log statements bearing the FATAL level. 11 | 12 | 13 | - if a method declares multipe loggers on the same line, the conversion will not be complete. Example: 14 | 15 | 16 | public void someMethod(Log l1, Log l2) { 17 | ... 18 | } 19 | 20 | will be converted as 21 | 22 | public void someMethod(Log l1, Logger l2) { 23 | ... 24 | } 25 | 26 | 27 | When migrating from log4j 28 | ========================= 29 | 30 | - Since NDC is not supported by SLF4J, the migrator cannot properly handle 31 | NDC statements. 32 | 33 | - Calls to PropertyConfigurator or DomConfigurator cannot be migrated since 34 | SLF4J the equivalents. 35 | -------------------------------------------------------------------------------- /slf4j-migrator/jcl/jclcontent.java: -------------------------------------------------------------------------------- 1 | /** 2 | *This is not a class, just a sample of some jcl source code to convert 3 | */ 4 | import org.apache.commons.logging.LogFactory; 5 | import org.apache.commons.logging.Log; 6 | 7 | 8 | Log l = LogFactory.getLog(MyClass.class); 9 | Log mylog=LogFactory.getLog(MyClass.class); 10 | Log mylog1 = LogFactory.getLog(MyClass.class); 11 | Log mylog2 = LogFactory.getLog(MyClass.class); 12 | 13 | Log log3=LogFactory.getFactory().getInstance(MyClass.class); 14 | Log mylog4 = LogFactory.getFactory().getInstance(MyClass.class); 15 | Log mylog5 = LogFactory.getLog(MyClass.class); 16 | 17 | Log myLog6; 18 | 19 | log7=LogFactory.getFactory().getInstance(MyClass.class); 20 | log8 =LogFactory.getFactory().getInstance(MyClass.class); 21 | myLog9 = LogFactory.getLog(MyClass.class); 22 | 23 | -------------------------------------------------------------------------------- /slf4j-migrator/pom.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | org.slf4j 9 | slf4j-parent 10 | 1.7.5 11 | 12 | 13 | 4.0.0 14 | 15 | org.slf4j 16 | slf4j-migrator 17 | jar 18 | SLF4J Migrator 19 | SLF4J Migrator 20 | 21 | 22 | 23 | 24 | 25 | org.apache.maven.plugins 26 | maven-compiler-plugin 27 | 28 | 1.5 29 | 1.5 30 | 31 | 32 | 33 | 34 | org.apache.maven.plugins 35 | maven-jar-plugin 36 | 37 | 38 | ${project.build.outputDirectory}/META-INF/MANIFEST.MF 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /slf4j-migrator/src/main/java/org/slf4j/migrator/Constant.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.migrator; 26 | 27 | public class Constant { 28 | 29 | public final static int JCL_TO_SLF4J = 0; 30 | public final static int LOG4J_TO_SLF4J = 1; 31 | public final static int JUL_TO_SLF4J = 2; 32 | public final static int NOP_TO_SLF4J = 3; 33 | 34 | public final static int NB_FILES_MAX = 1; 35 | 36 | } -------------------------------------------------------------------------------- /slf4j-migrator/src/main/java/org/slf4j/migrator/ConversionException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.migrator; 26 | 27 | public class ConversionException extends Exception { 28 | 29 | /** 30 | * 31 | */ 32 | private static final long serialVersionUID = 498961799888576668L; 33 | 34 | private String detail; 35 | 36 | public static final String NOT_IMPLEMENTED = "Conversion mode not implemented yet"; 37 | public static final String INVALID_DIRECTORY = "Invalid source directory"; 38 | public static final String FILE_COPY = "Error during file copy"; 39 | 40 | public ConversionException(String message) { 41 | super(message); 42 | } 43 | 44 | public ConversionException(String message, String detail) { 45 | super(message); 46 | this.detail = detail; 47 | } 48 | 49 | public String getDetail() { 50 | return detail; 51 | } 52 | 53 | public void setDetail(String detail) { 54 | this.detail = detail; 55 | } 56 | 57 | public void print() { 58 | if (getMessage() != null) { 59 | System.out.println(getMessage()); 60 | } 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /slf4j-migrator/src/main/java/org/slf4j/migrator/Main.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | 26 | package org.slf4j.migrator; 27 | 28 | import javax.swing.SwingUtilities; 29 | 30 | import org.slf4j.migrator.internal.MigratorFrame; 31 | 32 | /** 33 | * Main entry point to the migrator. 34 | * 35 | * @author Ceki Gülcü 36 | */ 37 | public class Main { 38 | 39 | public static void main(String[] args) { 40 | System.out.println("Starting SLF4J Migrator"); 41 | SwingUtilities.invokeLater(new Runnable() { 42 | public void run() { 43 | MigratorFrame inst = new MigratorFrame(); 44 | inst.setLocationRelativeTo(null); 45 | inst.setVisible(true); 46 | } 47 | }); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /slf4j-migrator/src/main/java/org/slf4j/migrator/internal/ConversionTask.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.migrator.internal; 26 | 27 | import java.io.File; 28 | 29 | import org.slf4j.migrator.ProjectConverter; 30 | 31 | public class ConversionTask implements Runnable { 32 | 33 | final File folder; 34 | final MigratorFrame frame; 35 | final int conversionType; 36 | 37 | 38 | ConversionTask(File folder, MigratorFrame frame, int conversionType) { 39 | this.folder = folder; 40 | this.frame = frame; 41 | this.conversionType = conversionType; 42 | } 43 | 44 | public void run() { 45 | ProgressListener pl = new ProgressListenerImpl(folder, frame); 46 | pl.onMigrationBegin(); 47 | ProjectConverter converter = new ProjectConverter(conversionType, pl); 48 | converter.convertProject(folder); 49 | } 50 | 51 | public void launch() { 52 | Thread t = new Thread(this); 53 | t.setDaemon(true); 54 | t.start(); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /slf4j-migrator/src/main/java/org/slf4j/migrator/internal/ProgressListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.migrator.internal; 26 | 27 | import java.io.File; 28 | 29 | public interface ProgressListener { 30 | 31 | public void onMigrationBegin(); 32 | public void onDirectory(File file); 33 | public void onFileAddition(File file); 34 | public void onFileScanBegin(); 35 | public void onFileScan(File file); 36 | public void onInplaceConversion(File file); 37 | public void onDone(); 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /slf4j-migrator/src/main/java/org/slf4j/migrator/line/ConversionRule.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.migrator.line; 26 | 27 | import java.util.regex.Matcher; 28 | import java.util.regex.Pattern; 29 | 30 | public interface ConversionRule { 31 | 32 | public Pattern getPattern(); 33 | 34 | /** 35 | * Given replacement rules, replace each capturing group in matcher's pattern 36 | * 37 | * @param matcher 38 | * @return String 39 | */ 40 | public String replace(Matcher matcher); 41 | 42 | /** 43 | * Returns a non-null value if there should be an additional line 44 | * following a match of this rule. In most cases this method 45 | * returns null. 46 | * 47 | * @return String 48 | */ 49 | public String getAdditionalLine(); 50 | 51 | } -------------------------------------------------------------------------------- /slf4j-migrator/src/main/java/org/slf4j/migrator/line/EmptyRuleSet.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.migrator.line; 26 | 27 | import java.util.ArrayList; 28 | import java.util.Iterator; 29 | import java.util.List; 30 | 31 | public class EmptyRuleSet implements RuleSet { 32 | 33 | List list = new ArrayList(); 34 | 35 | public Iterator iterator() { 36 | return list.iterator(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /slf4j-migrator/src/main/java/org/slf4j/migrator/line/RuleSet.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.migrator.line; 26 | 27 | import java.util.Iterator; 28 | 29 | 30 | public interface RuleSet { 31 | 32 | Iterator iterator(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /slf4j-migrator/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Main-Class: org.slf4j.migrator.Main -------------------------------------------------------------------------------- /slf4j-migrator/src/test/java/org/slf4j/migrator/AllTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.migrator; 26 | 27 | import junit.framework.Test; 28 | import junit.framework.TestCase; 29 | import junit.framework.TestSuite; 30 | 31 | public class AllTest extends TestCase { 32 | 33 | public static Test suite() { 34 | TestSuite suite = new TestSuite(); 35 | suite.addTest(org.slf4j.migrator.PackageTest.suite()); 36 | suite.addTest(org.slf4j.migrator.line.PackageTest.suite()); 37 | suite.addTest(org.slf4j.migrator.helper.PackageTest.suite()); 38 | 39 | return suite; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /slf4j-migrator/src/test/java/org/slf4j/migrator/FileConverterTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.migrator; 26 | 27 | import java.io.File; 28 | import java.io.IOException; 29 | 30 | import junit.framework.TestCase; 31 | 32 | import org.slf4j.migrator.InplaceFileConverter; 33 | import org.slf4j.migrator.internal.NopProgressListener; 34 | import org.slf4j.migrator.line.EmptyRuleSet; 35 | 36 | public class FileConverterTest extends TestCase { 37 | 38 | public FileConverterTest(String arg0) { 39 | super(arg0); 40 | } 41 | 42 | protected void setUp() throws Exception { 43 | super.setUp(); 44 | } 45 | 46 | protected void tearDown() throws Exception { 47 | super.tearDown(); 48 | } 49 | 50 | public void test() { 51 | } 52 | 53 | 54 | public void XtestNOP() throws IOException { 55 | InplaceFileConverter fc = new InplaceFileConverter(new EmptyRuleSet(), new NopProgressListener()); 56 | fc.convert(new File("c:/varargs.txt")); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /slf4j-migrator/src/test/java/org/slf4j/migrator/PackageTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.migrator; 26 | 27 | import junit.framework.Test; 28 | import junit.framework.TestCase; 29 | import junit.framework.TestSuite; 30 | 31 | public class PackageTest extends TestCase { 32 | 33 | public static Test suite() { 34 | TestSuite suite = new TestSuite(); 35 | suite.addTestSuite(AternativeApproach.class); 36 | return suite; 37 | } 38 | } -------------------------------------------------------------------------------- /slf4j-migrator/src/test/java/org/slf4j/migrator/ProjectConverterTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.migrator; 26 | 27 | import java.io.File; 28 | 29 | import org.slf4j.migrator.Constant; 30 | import org.slf4j.migrator.ProjectConverter; 31 | import org.slf4j.migrator.internal.NopProgressListener; 32 | 33 | import junit.framework.TestCase; 34 | 35 | public class ProjectConverterTest extends TestCase { 36 | 37 | public void test() { 38 | } 39 | 40 | public void XtestBarracuda() { 41 | ProjectConverter pc = new ProjectConverter(Constant.LOG4J_TO_SLF4J, 42 | new NopProgressListener()); 43 | File projectFolder = new File("c:/home/ceki//Varia/Barracuda"); 44 | pc.convertProject(projectFolder); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /slf4j-migrator/src/test/java/org/slf4j/migrator/helper/PackageTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.migrator.helper; 26 | 27 | import junit.framework.Test; 28 | import junit.framework.TestCase; 29 | import junit.framework.TestSuite; 30 | 31 | public class PackageTest extends TestCase { 32 | 33 | public static Test suite() { 34 | TestSuite suite = new TestSuite(); 35 | suite.addTestSuite(AbbreviatorTest.class); 36 | return suite; 37 | } 38 | } -------------------------------------------------------------------------------- /slf4j-migrator/src/test/java/org/slf4j/migrator/internal/NopProgressListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.migrator.internal; 26 | 27 | import java.io.File; 28 | 29 | import org.slf4j.migrator.internal.ProgressListener; 30 | 31 | public class NopProgressListener implements ProgressListener { 32 | 33 | public void onDirectory(File file) { 34 | } 35 | 36 | public void onDone() { 37 | } 38 | 39 | public void onFileAddition(File file) { 40 | } 41 | 42 | public void onFileScan(File file) { 43 | } 44 | 45 | public void onInplaceConversion(File file) { 46 | } 47 | 48 | public void onFileScanBegin() { 49 | } 50 | 51 | public void onMigrationBegin() { 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /slf4j-migrator/src/test/java/org/slf4j/migrator/line/PackageTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.migrator.line; 26 | 27 | import org.slf4j.migrator.line.JCLRuleSetTest; 28 | import org.slf4j.migrator.line.Log4jRuleSetTest; 29 | 30 | import junit.framework.Test; 31 | import junit.framework.TestCase; 32 | import junit.framework.TestSuite; 33 | 34 | public class PackageTest extends TestCase { 35 | 36 | public static Test suite() { 37 | TestSuite suite = new TestSuite(); 38 | suite.addTestSuite(TrivialMatcherTest.class); 39 | suite.addTestSuite(JCLRuleSetTest.class); 40 | suite.addTestSuite(Log4jRuleSetTest.class); 41 | suite.addTestSuite(NoConversionTest.class); 42 | return suite; 43 | } 44 | } -------------------------------------------------------------------------------- /slf4j-migrator/src/test/java/org/slf4j/migrator/line/TrivialMatcherTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.migrator.line; 26 | 27 | import org.slf4j.migrator.line.LineConverter; 28 | 29 | import junit.framework.TestCase; 30 | 31 | public class TrivialMatcherTest extends TestCase { 32 | 33 | public void testSimpleReplacement() { 34 | LineConverter trivialLC = new LineConverter(new TrivialMatcher()); 35 | 36 | 37 | // "import org.slf4j.converter" -- > simple replacement with an unique 38 | // capturing group 39 | assertEquals("simple replacement with an unique capturing group", 40 | trivialLC.getOneLineReplacement("import org.slf4j.converter")); 41 | 42 | assertEquals("1st group second group 4th group", trivialLC 43 | .getOneLineReplacement("first group second group third group 4th group")); 44 | 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /slf4j-nop/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2007 QOS.ch 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /slf4j-nop/pom.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | org.slf4j 8 | slf4j-parent 9 | 1.7.5 10 | 11 | 12 | 4.0.0 13 | 14 | org.slf4j 15 | slf4j-nop 16 | jar 17 | SLF4J NOP Binding 18 | SLF4J NOP Binding 19 | http://www.slf4j.org 20 | 21 | 22 | 23 | 24 | org.slf4j 25 | slf4j-api 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | org.apache.maven.plugins 34 | maven-jar-plugin 35 | 36 | 37 | 38 | ${parsedVersion.osgiVersion} 39 | ${project.description} 40 | ${project.version} 41 | 42 | ${project.build.outputDirectory}/META-INF/MANIFEST.MF 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /slf4j-nop/src/main/java/org/slf4j/impl/StaticMDCBinder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.impl; 26 | 27 | import org.slf4j.helpers.NOPMDCAdapter; 28 | import org.slf4j.spi.MDCAdapter; 29 | 30 | 31 | /** 32 | * This implementation is bound to {@link NOPMDCAdapter}. 33 | * 34 | * @author Ceki Gülcü 35 | */ 36 | public class StaticMDCBinder { 37 | 38 | 39 | /** 40 | * The unique instance of this class. 41 | */ 42 | public static final StaticMDCBinder SINGLETON = new StaticMDCBinder(); 43 | 44 | private StaticMDCBinder() { 45 | } 46 | 47 | /** 48 | * Currently this method always returns an instance of 49 | * {@link StaticMDCBinder}. 50 | */ 51 | public MDCAdapter getMDCA() { 52 | return new NOPMDCAdapter(); 53 | } 54 | 55 | public String getMDCAdapterClassStr() { 56 | return NOPMDCAdapter.class.getName(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /slf4j-nop/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Implementation-Title: slf4j-nop 2 | Bundle-ManifestVersion: 2 3 | Bundle-SymbolicName: slf4j.nop 4 | Bundle-Name: slf4j-nop 5 | Bundle-Vendor: SLF4J.ORG 6 | Bundle-RequiredExecutionEnvironment: J2SE-1.3 7 | Export-Package: org.slf4j.impl;version=${parsedVersion.osgiVersion} 8 | Import-Package: org.slf4j;version=${parsedVersion.osgiVersion}, org.slf4j.spi;version=${parsedVersion.osgiVersion}, org.slf4j.helpers;version=${parsedVersion.osgiVersion} 9 | Fragment-Host: slf4j.api -------------------------------------------------------------------------------- /slf4j-simple/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2007 QOS.ch 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /slf4j-simple/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | org.slf4j 6 | slf4j-parent 7 | 1.7.5 8 | 9 | 10 | 4.0.0 11 | 12 | org.slf4j 13 | slf4j-simple 14 | jar 15 | SLF4J Simple Binding 16 | SLF4J Simple binding 17 | http://www.slf4j.org 18 | 19 | 20 | 21 | org.slf4j 22 | slf4j-api 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | org.apache.maven.plugins 31 | maven-jar-plugin 32 | 33 | 34 | 35 | ${parsedVersion.osgiVersion} 36 | ${project.description} 37 | ${project.version} 38 | 39 | ${project.build.outputDirectory}/META-INF/MANIFEST.MF 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /slf4j-simple/src/main/java/org/slf4j/impl/StaticMDCBinder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j.impl; 26 | 27 | import org.slf4j.helpers.NOPMDCAdapter; 28 | import org.slf4j.spi.MDCAdapter; 29 | 30 | 31 | /** 32 | * This implementation is bound to {@link NOPMDCAdapter}. 33 | * 34 | * @author Ceki Gülcü 35 | */ 36 | public class StaticMDCBinder { 37 | 38 | 39 | /** 40 | * The unique instance of this class. 41 | */ 42 | public static final StaticMDCBinder SINGLETON = new StaticMDCBinder(); 43 | 44 | private StaticMDCBinder() { 45 | } 46 | 47 | /** 48 | * Currently this method always returns an instance of 49 | * {@link StaticMDCBinder}. 50 | */ 51 | public MDCAdapter getMDCA() { 52 | return new NOPMDCAdapter(); 53 | } 54 | 55 | public String getMDCAdapterClassStr() { 56 | return NOPMDCAdapter.class.getName(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /slf4j-simple/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Implementation-Title: slf4j-simple 2 | Bundle-ManifestVersion: 2 3 | Bundle-SymbolicName: slf4j.simple 4 | Bundle-Name: slf4j-simple 5 | Bundle-Vendor: SLF4J.ORG 6 | Require-Bundle: slf4j.api 7 | Bundle-RequiredExecutionEnvironment: J2SE-1.3 8 | Export-Package: org.slf4j.impl;version=${parsedVersion.osgiVersion} 9 | Import-Package: org.slf4j;version=${parsedVersion.osgiVersion}, org.slf4j.spi;version=${parsedVersion.osgiVersion}, org.slf4j.helpers;version=${parsedVersion.osgiVersion} 10 | Fragment-Host: slf4j.api -------------------------------------------------------------------------------- /slf4j-simple/src/test/java/org/slf4j/SilentPrintStream.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2004-2011 QOS.ch 3 | * All rights reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | */ 25 | package org.slf4j; 26 | 27 | import java.io.PrintStream; 28 | 29 | public class SilentPrintStream extends PrintStream { 30 | 31 | PrintStream other; 32 | 33 | public SilentPrintStream(PrintStream ps) { 34 | super(ps); 35 | other = ps; 36 | } 37 | 38 | public void print(String s) { 39 | } 40 | 41 | public void println(String s) { 42 | } 43 | 44 | public void println(Object x) { 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /slf4j-simple/src/test/resources/simplelogger.properties: -------------------------------------------------------------------------------- 1 | # SLF4J's SimpleLogger configuration file 2 | # Simple implementation of Logger that sends all enabled log messages, for all defined loggers, to System.err. 3 | 4 | # Default logging detail level for all instances of SimpleLogger. 5 | # Must be one of ("trace", "debug", "info", "warn", or "error"). 6 | # If not specified, defaults to "info". 7 | #org.slf4j.simpleLogger.defaultLog=info 8 | 9 | # Logging detail level for a SimpleLogger instance named "xxxxx". 10 | # Must be one of ("trace", "debug", "info", "warn", or "error"). 11 | # If not specified, the default logging detail level is used. 12 | #org.slf4j.simpleLogger.log.xxxxx= 13 | 14 | # Set to true if you want the current date and time to be included in output messages. 15 | # Default is false, and will output the number of milliseconds elapsed since startup. 16 | #org.slf4j.simpleLogger.showDateTime=false 17 | 18 | # The date and time format to be used in the output messages. 19 | # The pattern describing the date and time format is the same that is used in java.text.SimpleDateFormat. 20 | # If the format is not specified or is invalid, the default format is used. 21 | # The default format is yyyy-MM-dd HH:mm:ss:SSS Z. 22 | #org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss:SSS Z 23 | 24 | # Set to true if you want to output the current thread name. 25 | # Defaults to true. 26 | #org.slf4j.simpleLogger.showThreadName=true 27 | 28 | # Set to true if you want the Logger instance name to be included in output messages. 29 | # Defaults to true. 30 | #org.slf4j.simpleLogger.showLogName=true 31 | 32 | # Set to true if you want the last component of the name to be included in output messages. 33 | # Defaults to false. 34 | #org.slf4j.simpleLogger.showShortLogName=false 35 | -------------------------------------------------------------------------------- /slf4j-site/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2007 QOS.ch 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /slf4j-site/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | org.slf4j 7 | slf4j-parent 8 | 1.7.5 9 | 10 | 11 | 4.0.0 12 | 13 | org.slf4j 14 | slf4j-site 15 | jar 16 | SLF4J Site 17 | SLF4J Site 18 | http://www.slf4j.org 19 | 20 | 21 | 22 | 23 | src/site/pages 24 | 25 | 26 | ../../../target/site 27 | true 28 | 29 | 30 | 31 | 32 | org.apache.maven.plugins 33 | maven-site-plugin 34 | 35 | ${project.parent.basedir}/target/site 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /slf4j-site/src/site/images.src/bindings.flw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/images.src/bindings.flw -------------------------------------------------------------------------------- /slf4j-site/src/site/images.src/bridging-black.flw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/images.src/bridging-black.flw -------------------------------------------------------------------------------- /slf4j-site/src/site/images.src/bridging.flw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/images.src/bridging.flw -------------------------------------------------------------------------------- /slf4j-site/src/site/images.src/concrete-bindings.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/images.src/concrete-bindings.odg -------------------------------------------------------------------------------- /slf4j-site/src/site/images.src/core-bindings.flw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/images.src/core-bindings.flw -------------------------------------------------------------------------------- /slf4j-site/src/site/images.src/core-bindings1.flw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/images.src/core-bindings1.flw -------------------------------------------------------------------------------- /slf4j-site/src/site/images.src/core-bindings2.flw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/images.src/core-bindings2.flw -------------------------------------------------------------------------------- /slf4j-site/src/site/images.src/core-bindings3.flw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/images.src/core-bindings3.flw -------------------------------------------------------------------------------- /slf4j-site/src/site/images.src/legacy.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/images.src/legacy.odg -------------------------------------------------------------------------------- /slf4j-site/src/site/pages/.htaccess: -------------------------------------------------------------------------------- 1 | Redirect permanent /log4j-over-slf4j.html http://www.slf4j.org/legacy.html#log4j-over-slf4j -------------------------------------------------------------------------------- /slf4j-site/src/site/pages/changes/changes-1.3.txt: -------------------------------------------------------------------------------- 1 | 2 | Changes in SLF4J 1.3.0 with respect to 1.2 as reported by the clirr 3 | tool. 4 | 5 | slf4j-api 6 | ========= 7 | 8 | INFO: 6000: org.slf4j.Logger: Added public field ROOT_LOGGER_NAME 9 | INFO: 8000: org.slf4j.LoggerFactory: Class org.slf4j.LoggerFactory added 10 | INFO: 8000: org.slf4j.MarkerFactory: Class org.slf4j.MarkerFactory added 11 | INFO: 8000: org.slf4j.helpers.BasicMarker: Class org.slf4j.helpers.BasicMarker added 12 | INFO: 8000: org.slf4j.helpers.BasicMarkerFactory: Class org.slf4j.helpers.BasicMarkerFactory added 13 | INFO: 8000: org.slf4j.helpers.MarkerIgnoringBase: Class org.slf4j.helpers.MarkerIgnoringBase added 14 | INFO: 8000: org.slf4j.helpers.MessageFormatter: Class org.slf4j.helpers.MessageFormatter added 15 | INFO: 8000: org.slf4j.helpers.Util: Class org.slf4j.helpers.Util added 16 | ERROR: 8001: org.slf4j.impl.BasicMarker: Class org.slf4j.impl.BasicMarker removed 17 | ERROR: 8001: org.slf4j.impl.BasicMarkerFactory: Class org.slf4j.impl.BasicMarkerFactory removed 18 | ERROR: 8001: org.slf4j.impl.MarkerIgnoringBase: Class org.slf4j.impl.MarkerIgnoringBase removed 19 | ERROR: 8001: org.slf4j.impl.MessageFormatter: Class org.slf4j.impl.MessageFormatter removed 20 | ERROR: 8001: org.slf4j.impl.Util: Class org.slf4j.impl.Util removed 21 | INFO: 8000: org.slf4j.spi.LocationAwareLogger: Class org.slf4j.spi.LocationAwareLogger added 22 | 23 | slf4j-nop 24 | ========= 25 | 26 | ERROR: 8001: org.slf4j.LoggerFactory: Class org.slf4j.LoggerFactory removed 27 | ERROR: 8001: org.slf4j.MarkerFactory: Class org.slf4j.MarkerFactory removed 28 | 29 | slf4j-simple 30 | ============ 31 | 32 | ERROR: 8001: org.slf4j.LoggerFactory: Class org.slf4j.LoggerFactory removed 33 | ERROR: 8001: org.slf4j.MarkerFactory: Class org.slf4j.MarkerFactory removed 34 | 35 | slf4j-log4j12 36 | ============= 37 | 38 | ERROR: 8001: org.slf4j.LoggerFactory: Class org.slf4j.LoggerFactory removed 39 | ERROR: 8001: org.slf4j.MarkerFactory: Class org.slf4j.MarkerFactory removed 40 | 41 | slf4j-jdk14 42 | =========== 43 | 44 | ERROR: 8001: org.slf4j.LoggerFactory: Class org.slf4j.LoggerFactory removed 45 | ERROR: 8001: org.slf4j.MarkerFactory: Class org.slf4j.MarkerFactory removed -------------------------------------------------------------------------------- /slf4j-site/src/site/pages/css/popup.css: -------------------------------------------------------------------------------- 1 | 2 | /* =========== popup ================== */ 3 | #backgroundPopup { 4 | display:none; 5 | position:fixed; 6 | _position:absolute; /* hack for internet explorer 6*/ 7 | height:100%; 8 | width:100%; 9 | top:0; 10 | left:0; 11 | background:#000000; 12 | border:1px solid #cecece; 13 | z-index:1; 14 | } 15 | 16 | #popupContents { 17 | display:none; 18 | position:fixed; 19 | _position:absolute; /* hack for internet explorer 6*/ 20 | height: 150px; 21 | width: 408px; 22 | background:#FFFFFF; 23 | border: 2px solid #cecece; 24 | z-index:2; 25 | padding-left: 1ex; 26 | font-size:13px; 27 | } 28 | 29 | #popupContents p { 30 | margin: 0px; 31 | } 32 | #popupContents h3 { 33 | margin: 0px; 34 | } 35 | 36 | #popupContactClose { 37 | font-size:14px; 38 | line-height:14px; 39 | right:6px; 40 | top:4px; 41 | position:absolute; 42 | color:#6fa5fd; 43 | font-weight:700; 44 | display:block; 45 | } 46 | 47 | a.popupLink { 48 | background: #FFF; 49 | color: #0079C5; 50 | font-family: "Comic Sans MS", sans-serif; 51 | white-space: nowrap; 52 | font-size: 14px; 53 | font-weight: bold; 54 | 55 | border-top: 2px solid #DDD; 56 | border-left: 2px solid #DDD; 57 | border-right: 2px solid #888; 58 | border-bottom: 2px solid #888; 59 | padding: 0px 1em 0px 1em; 60 | margin: 0px 0px 3px 0px; 61 | } 62 | 63 | a.popupLink:hover { 64 | background: #E0E0EF; 65 | cursor: pointer; 66 | } 67 | 68 | -------------------------------------------------------------------------------- /slf4j-site/src/site/pages/css/prettify.css: -------------------------------------------------------------------------------- 1 | .str{color:#080} 2 | .kwd{color:#008} 3 | .com{color:#800} 4 | .typ{color:#606} 5 | .lit{color:#066} 6 | .pun{color:#660} 7 | .pln{color:#000} 8 | .tag{color:#008} 9 | .atn{color:#606} 10 | .atv{color:#080} 11 | .dec{color:#606} 12 | 13 | pre.prettyprint{ 14 | padding:2px; 15 | border-top: 1px solid #888; border-bottom: 1px solid #888; 16 | } 17 | @media print{.str{color:#060} 18 | 19 | .kwd{ 20 | color:#006;font-weight:bold} 21 | .com{color:#600;font-style:italic 22 | } 23 | .typ{color:#404;font-weight:bold} 24 | .lit{color:#044} 25 | .pun{color:#440} 26 | .pln{color:#000} 27 | .tag{color:#006;font-weight:bold} 28 | .atn{color:#404} 29 | .atv{color:#060}} -------------------------------------------------------------------------------- /slf4j-site/src/site/pages/inde_base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SLF4J 6 | 7 | 8 | 9 | 12 | 13 | 14 |
15 | 16 |
17 | 20 |
21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | -------------------------------------------------------------------------------- /slf4j-site/src/site/pages/support.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Log4j Bridge 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 |
17 | 18 |
19 | 22 |
23 | 24 |

Contractual Support

25 | 26 | 27 |

The following companies, listed in alphabetical order, offer 28 | contractual support for SLF4J. 29 |

30 | 31 |
    32 |
  • QOS.ch, in Lausanne, Swizerland. For more information visit 33 | QOS.ch's support page.
  • 34 |
35 | 36 | 37 | 38 | 39 |
40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /slf4j-site/src/site/pages/templates/footer.js: -------------------------------------------------------------------------------- 1 | 2 | document.write('') 3 | 4 | document.write('') 5 | 6 | document.write(' ') 7 | 8 | document.write(' '); 13 | 14 | 15 | document.write('') 16 | 17 | AAT = '@' 18 | DOOTT = '.' 19 | document.write('') 20 | document.write('') 23 | document.write('') 24 | 25 | 26 | document.write('') 27 | 28 | 29 | -------------------------------------------------------------------------------- /slf4j-site/src/site/pages/templates/header.js: -------------------------------------------------------------------------------- 1 | 2 | document.write(''); 3 | document.write('') 6 | 7 | //document.write('') 10 | 11 | document.write('
'); 4 | document.write(''); 5 | document.write(''); 8 | //document.write(''); 9 | //document.write('
'); 12 | document.write(''); -------------------------------------------------------------------------------- /slf4j-site/src/site/pages/templates/left.js: -------------------------------------------------------------------------------- 1 | 2 | document.write(''); 34 | 35 | document.write('

 

'); 36 | document.write(''); 37 | 38 | 39 | document.write('

 

'); 40 | document.write('

'); 41 | document.write(' '); 42 | document.write(' buy direct from the developer'); 43 | document.write(' '); 44 | document.write('

'); 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /slf4j-site/src/site/pages/templates/right.js: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/css/anchor12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/css/anchor12.png -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/css/anchor16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/css/anchor16.png -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/css/anchor20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/css/anchor20.png -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/css/anchor24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/css/anchor24.png -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/images/PythonPowered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/images/PythonPowered.png -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/images/bindings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/images/bindings.png -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/images/bridging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/images/bridging.png -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/images/buyDirect.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/images/buyDirect.jpg -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/images/concrete-bindings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/images/concrete-bindings.png -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/images/devoxx09.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/images/devoxx09.jpeg -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/images/gnu-head-tiny.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/images/gnu-head-tiny.jpg -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/images/jazoon09.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/images/jazoon09.gif -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/images/legacy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/images/legacy.png -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/images/logos/qosLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/images/logos/qosLogo.png -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/images/logos/qoslogo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/images/logos/qoslogo.gif -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/images/logos/slf4j-logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/images/logos/slf4j-logo.jpg -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/images/logos/slf4j-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/images/logos/slf4j-small.jpg -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/images/logos/valid-html401.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/images/logos/valid-html401.png -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/images/mailman.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/images/mailman.jpg -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/images/myjob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/images/myjob.png -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/images/slf4j-migrator.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/images/slf4j-migrator.gif -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/images/twitter-bird-light-bgs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/images/twitter-bird-light-bgs.png -------------------------------------------------------------------------------- /slf4j-site/src/site/resources/slf4j-in-10-slides.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/slf4j-site/src/site/resources/slf4j-in-10-slides.ppt -------------------------------------------------------------------------------- /src/main/javadocHeaders.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | /** 4 | * 5 | */ 6 | 7 | (\s|\t)*/\*.*$ 8 | .*\*/(\s|\t)*$ 9 | 10 | -------------------------------------------------------------------------------- /src/main/licenseHeader.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2011 QOS.ch 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twwwt/slf4j/1e706fa4544bba7845a8964258015b85db35931c/test -------------------------------------------------------------------------------- /version.pl: -------------------------------------------------------------------------------- 1 | 2 | if ($#ARGV < 1) { 3 | print "Usage: version.pl VER FILE {FILE, FILE}\n"; 4 | exit; 5 | } 6 | 7 | $V=$ARGV[0]; 8 | print "VER:'${V}'\r\n"; 9 | shift(@ARGV); 10 | 11 | sub replace () { 12 | my $filename = $_[0]; 13 | 14 | if(-s $filename) { 15 | print "Processing [" . $filename . "]\r\n"; 16 | 17 | my $original = "$filename.original"; 18 | 19 | rename($filename, $original); 20 | open(OUT, ">$filename"); 21 | open(IN, "$original"); 22 | 23 | my $hitCount=0; 24 | while() { 25 | if($hitCount == 0 && /.*<\/version>/) { 26 | s/.*<\/version>/${V}<\/version>/; 27 | $hitCount++; 28 | } 29 | print OUT; 30 | } 31 | close(IN); 32 | close(OUT); 33 | unlink($original); 34 | } else { 35 | print "File [" . $filename . "] does not exist\r\n" 36 | } 37 | } 38 | 39 | foreach $ARG (@ARGV) { 40 | do replace($ARG); 41 | } 42 | 43 | 44 | 45 | --------------------------------------------------------------------------------