[GitHub] DaanHoogland edited a comment on issue #2992: PoC for log library surface reduction (2991)
DaanHoogland edited a comment on issue #2992: PoC for log library surface reduction (2991) URL: https://github.com/apache/cloudstack/pull/2992#issuecomment-461505256 used a addepted version of @rafaelweingartner's script above : ``` #!/bin/bash CLOUDSTACK_FOLDER="." ALL_CLOUDSTACK_CLASSES=$(find $CLOUDSTACK_FOLDER -name "*.java") for class in $ALL_CLOUDSTACK_CLASSES do count=$((count+1)) echo "Processing ($count) class: $class" echo "Replacing org.apache.log4j.Level with org.apache.cloudstack.utils.log.Level" sed -i .loch 's/org.apache.log4j.Level/org.apache.cloudstack.utils.log.Level/g' "$class" echo "Replacing org.apache.log4j.Logger with org.apache.cloudstack.utils.log.Logger" sed -i .loch 's/org.apache.log4j.Logger/org.apache.cloudstack.utils.log.Logger/g' "$class" echo "Replacing java.util.logging.Logger with org.apache.cloudstack.utils.log.Logger" sed -i .loch 's/java.util.logging.Logger/org.apache.cloudstack.utils.log.Logger/g' "$class" echo "Adding import to org.apache.cloudstack.utils.log.LogFactory" sed -i .loch '/import org.apache.cloudstack.utils.log.Logger/a \ import org.apache.cloudstack.utils.log.LogFactory; ' "$class" echo "Replacing Logger.getLogger with LogFactory.getLogger" sed -i .loch 's/Logger.getLogger/LogFactory.getLogger/g' "$class" echo "Replacing org.slf4j.Logger with org.apache.cloudstack.utils.log.Logger" sed -i .loch 's/org.slf4j.Logger/org.apache.cloudstack.utils.log.Logger/g' "$class" echo "Replacing org.slf4j.LoggerFactory with org.apache.cloudstack.utils.log.LogFactory" sed -i .loch 's/org.slf4j.LoggerFactory/org.apache.cloudstack.utils.log.LogFactory/g' "$class" echo "Replacing s_logger with LOG" sed -i .loch 's/s_logger/LOG/g' "$class" done ``` the above scripts leaves some to be desired like: # 1. I don't have a constructor taking a String, yet. there where only a handful of those and all used a Class.getname, so I converted the calls instead. 1. on occasion the script led to a double insertion of the factory import. fixed those by hand as well This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland edited a comment on issue #2992: PoC for log library surface reduction (2991)
DaanHoogland edited a comment on issue #2992: PoC for log library surface reduction (2991) URL: https://github.com/apache/cloudstack/pull/2992#issuecomment-458615431 @rafaelweingartner I saw you IM comment and will look into what implementing logging like in spring would mean for our logging. more later This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland edited a comment on issue #2992: PoC for log library surface reduction (2991)
DaanHoogland edited a comment on issue #2992: PoC for log library surface reduction (2991) URL: https://github.com/apache/cloudstack/pull/2992#issuecomment-458521354 > I also do not see the benefits of this PR. It makes no sense not isolating dependencies and reducing surface area and this is just the most trivial example of that. I have given the benefits of such a way of working. What part do you disagree on? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland edited a comment on issue #2992: PoC for log library surface reduction (2991)
DaanHoogland edited a comment on issue #2992: PoC for log library surface reduction (2991) URL: https://github.com/apache/cloudstack/pull/2992#issuecomment-439378952 > Anyways, to upgrade the log4j is not as a Dantesc task as you are portraiting. I am almost done, and I have almost had no time to work on it. I can finish, and then show you for us to discuss if you have an open mind. If you unify the log framework usage as well, I am open to your solution. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services