Replace logging infrastructure with Log4j
authorSteve Lawrence <slawrence@apache.org>
Thu, 8 Jul 2021 12:29:25 +0000 (08:29 -0400)
committerSteve Lawrence <stephen.d.lawrence@gmail.com>
Mon, 16 Aug 2021 11:32:49 +0000 (07:32 -0400)
commit51b814e5b82f6d103e9d52ff22a0661e0d7c8884
tree2cf56d694e6ee47f365236c4ac2daad80b37a167
parent2c71cb2f24184012b48834205136f471e90da6ac
Replace logging infrastructure with Log4j

- Remove the existing logging infrastructure and replace it with the
  Log4j Scala API. Log4j Scala API and Log4j API are added as
  dependencies. Log4j Core is added as a test dependency and a CLI
  dependency. Users of the Daffodil API are expected to manually add
  log4j-core or some other Log4j implementation to enable logging
- Distribute a Log4j configuration with the CLI to maintain a similar
  log outut as with the previous implementation
- The Scala/Java API logging functions are deprecated and are now
  no-ops. The functions were not thread safe and could lead to random
  test failures. Logging tests are removed--we simply use the API and
  rely on Log4j testing for correctness
- We no longer have the different log levels as before, we know just
  have error, warn, info, debug, and trace
- Modify .sh and .bat files to be consistent and add a more clear way
  to set default java options that can be overridden by the user if
  needed
- Minor refactor of UDF to improve logging and allow warn+ignore
  provider loading errors

DAFFODIL-2510
82 files changed:
daffodil-cli/bin.NOTICE
daffodil-cli/build.sbt
daffodil-cli/src/conf/log4j2.xml [new file with mode: 0644]
daffodil-cli/src/it/scala/org/apache/daffodil/parsing/TestCLIParsing.scala
daffodil-cli/src/it/scala/org/apache/daffodil/saving/TestCLISaveParser.scala
daffodil-cli/src/it/scala/org/apache/daffodil/udf/TestCLIUdfs.scala
daffodil-cli/src/it/scala/org/apache/daffodil/unparsing/TestCLIUnparsing.scala
daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
daffodil-cli/src/templates/bash-template
daffodil-cli/src/templates/bat-template
daffodil-core/src/main/scala/org/apache/daffodil/compiler/Compiler.scala
daffodil-core/src/main/scala/org/apache/daffodil/dsom/DFDLFormatAnnotation.scala
daffodil-core/src/main/scala/org/apache/daffodil/dsom/DFDLSchemaFile.scala
daffodil-core/src/main/scala/org/apache/daffodil/dsom/Import.scala
daffodil-core/src/main/scala/org/apache/daffodil/dsom/Include.scala
daffodil-core/src/main/scala/org/apache/daffodil/dsom/PropProviders.scala
daffodil-core/src/main/scala/org/apache/daffodil/dsom/SchemaDocIncludesAndImportsMixin.scala
daffodil-core/src/main/scala/org/apache/daffodil/grammar/Production.scala
daffodil-core/src/main/scala/org/apache/daffodil/runtime1/SchemaSetRuntime1Mixin.scala
daffodil-core/src/test/scala/org/apache/daffodil/dsom/TestDsomCompiler.scala
daffodil-core/src/test/scala/org/apache/daffodil/dsom/TestInputValueCalc.scala
daffodil-core/src/test/scala/org/apache/daffodil/dsom/TestInteriorAlignmentElimination.scala
daffodil-core/src/test/scala/org/apache/daffodil/dsom/TestIsScannable.scala
daffodil-core/src/test/scala/org/apache/daffodil/dsom/TestMiddleEndAttributes2.scala
daffodil-core/src/test/scala/org/apache/daffodil/dsom/TestPolymorphicUpwardRelativeExpressions.scala
daffodil-core/src/test/scala/org/apache/daffodil/dsom/TestPropertyScoping.scala
daffodil-core/src/test/scala/org/apache/daffodil/dsom/TestRefMap.scala
daffodil-core/src/test/scala/org/apache/daffodil/externalvars/TestExternalVariables.scala
daffodil-core/src/test/scala/org/apache/daffodil/general/TestTunables.scala
daffodil-io/src/main/scala/org/apache/daffodil/io/DataOutputStream.scala
daffodil-io/src/main/scala/org/apache/daffodil/io/DataOutputStreamImplMixin.scala
daffodil-io/src/main/scala/org/apache/daffodil/io/DataStreamCommonImplMixin.scala
daffodil-io/src/main/scala/org/apache/daffodil/io/DirectOrBufferedDataOutputStream.scala
daffodil-japi/src/main/java/org/apache/daffodil/japi/logger/LogLevel.java
daffodil-japi/src/main/java/org/apache/daffodil/japi/logger/package-info.java [deleted file]
daffodil-japi/src/main/scala/org/apache/daffodil/japi/Daffodil.scala
daffodil-japi/src/main/scala/org/apache/daffodil/japi/logger/Logger.scala
daffodil-japi/src/main/scala/org/apache/daffodil/japi/packageprivate/Utils.scala
daffodil-japi/src/test/java/org/apache/daffodil/example/LogWriterForJAPITest.java [deleted file]
daffodil-japi/src/test/java/org/apache/daffodil/example/LogWriterForJAPITest2.java [deleted file]
daffodil-japi/src/test/java/org/apache/daffodil/example/TestJavaAPI.java
daffodil-lib/src/main/scala/org/apache/daffodil/oolag/OOLAG.scala
daffodil-lib/src/main/scala/org/apache/daffodil/schema/annotation/props/Properties.scala
daffodil-lib/src/main/scala/org/apache/daffodil/util/Enum.scala
daffodil-lib/src/main/scala/org/apache/daffodil/util/Logger.scala
daffodil-lib/src/main/scala/org/apache/daffodil/util/Timer.scala
daffodil-lib/src/main/scala/org/apache/daffodil/xml/DaffodilXMLLoader.scala
daffodil-lib/src/test/scala/org/apache/daffodil/oolag/TestOOLAG.scala
daffodil-lib/src/test/scala/org/apache/daffodil/util/TestLogger.scala [deleted file]
daffodil-macro-lib/src/main/scala/org/apache/daffodil/util/LoggerMacros.scala [deleted file]
daffodil-propgen/src/main/scala/org/apache/daffodil/propGen/TunableGenerator.scala
daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/DelimitedUnparsers.scala
daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/DelimiterUnparsers.scala
daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/ElementUnparser.scala
daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/FramingUnparsers.scala
daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/SpecifiedLength2.scala
daffodil-runtime1/src/main/scala/org/apache/daffodil/dpath/SuspendableExpression.scala
daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/InfosetImpl.scala
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DFDLDelimiter.scala
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/ProcessorBases.scala
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/ProcessorStateBases.scala
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/SuspendableOperation.scala
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/Suspension.scala
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/SuspensionTracker.scala
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/ElementCombinator1.scala
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/ElementKindParsers.scala
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/ExpressionEvaluatingParsers.scala
daffodil-runtime1/src/main/scala/org/apache/daffodil/udf/UserDefinedFunctionErrors.scala
daffodil-runtime1/src/main/scala/org/apache/daffodil/udf/UserDefinedFunctionService.scala
daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/Daffodil.scala
daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/logger/Logger.scala
daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/logger/package.scala [deleted file]
daffodil-sapi/src/main/scala/org/apache/daffodil/sapi/packageprivate/Utils.scala
daffodil-sapi/src/test/scala/org/apache/daffodil/example/LogWriterForSAPITest.scala [deleted file]
daffodil-sapi/src/test/scala/org/apache/daffodil/example/LogWriterForSAPITest2.scala [deleted file]
daffodil-sapi/src/test/scala/org/apache/daffodil/example/TestScalaAPI.scala
daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala
daffodil-test/src/test/scala/org/apache/daffodil/section06/namespaces/TestNamespaces.scala
daffodil-test/src/test/scala/org/apache/daffodil/section07/escapeScheme/TestEscapeScheme.scala
daffodil-test/src/test/scala/org/apache/daffodil/section12/lengthKind/TestLengthKindImplicit.scala
daffodil-test/src/test/scala/org/apache/daffodil/section15/choice_groups/TestChoice.scala
project/Dependencies.scala