stevedlawrence commented on code in PR #954:
URL: https://github.com/apache/daffodil/pull/954#discussion_r1101410772


##########
build.sbt:
##########
@@ -47,30 +68,34 @@ lazy val macroLib         = Project("daffodil-macro-lib", 
file("daffodil-macro-l
 lazy val propgen          = Project("daffodil-propgen", 
file("daffodil-propgen")).configs(IntegrationTest)
                               .settings(commonSettings, nopublish)
 
+lazy val slf4jLogger      = Project("daffodil-slf4j-logger", 
file("daffodil-slf4j-logger")).configs(IntegrationTest)
+                              .settings(commonSettings)
+                              .settings(libraryDependencies ++= 
Dependencies.slf4jAPI)
+

Review Comment:
   Yeah, its all about making it easier to control when this backend is used.
   
   The only projects that need a `runtime` dependency on this custom sl4fj 
backend are the CLI and TDML processor since those actually need this special 
thread specific logging. All the other projects should not have a runtime 
dependency to this backed because API users need the ability to plug in 
whatever backend they want (logback, log4j, JUL, etc). If we make it part of 
the actual library, and an API users adds a custom backend, then there will be 
two backends on the classpath and slf4j will output a warning and just pick 
whatever backend it sees first, which might not be the one the user wanted. 
Note that these projects do want to use it as a  `test` dependency, otherwise 
slf4j complains that no backend is available. We could alternatively give them 
a `test` dependency to something like `slf4j-simple`, but that makes it 
difficult to capture logs if we some unit test ever wants to, and I figure it's 
better to eat our own dogfood.
   
   So in short, making it a separate project makes it easier to make it a 
runtime dependency for daffodil-cli and daffodil-tdml-processor, and a test 
dependency for all the other jars.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to