You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ppkarwasz (via GitHub)" <gi...@apache.org> on 2023/01/23 07:10:00 UTC

[GitHub] [logging-log4j2] ppkarwasz commented on a diff in pull request #1222: Use setters for builder classes

ppkarwasz commented on code in PR #1222:
URL: https://github.com/apache/logging-log4j2/pull/1222#discussion_r1083689526


##########
log4j-core-test/src/test/java/org/apache/logging/log4j/core/config/LoggerConfigTest.java:
##########
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
 package org.apache.logging.log4j.core.config;/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements. See the NOTICE file distributed with

Review Comment:
   One of the problems with Spotless: if a license is present **after** the package declaration, Spotless will insert another one.



##########
log4j-core/src/main/java/org/apache/logging/log4j/core/appender/nosql/NoSqlAppender.java:
##########
@@ -74,9 +74,6 @@ public NoSqlAppender build() {
 
             final NoSqlDatabaseManager<?> manager = NoSqlDatabaseManager.getNoSqlDatabaseManager(managerName,
                     bufferSize, provider);
-            if (manager == null) {
-                return null;
-            }

Review Comment:
   Shouldn't we keep this?



##########
log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java:
##########
@@ -130,19 +129,31 @@ public static <B extends Builder<B>> B newBuilder() {
         @PluginBuilderAttribute
         private boolean direct;
 
-        public B setTarget(final Target aTarget) {
+        public Target getTarget() {
+            return target;
+        }
+
+        public boolean isFollow() {
+            return follow;
+        }
+
+        public boolean isDirect() {
+            return direct;
+        }

Review Comment:
   Is this useful on the **builder**? I would prefer to see these on the `ConsoleAppender` itself (to be able to read the appender's configuration in runtime)



-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org