You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "NetShrimp06 (via GitHub)" <gi...@apache.org> on 2023/03/14 15:47:36 UTC

[GitHub] [doris] NetShrimp06 opened a new pull request, #17797: [Enhancement] (fe exception) write a java annotation to catch throwable from a method and print log

NetShrimp06 opened a new pull request, #17797:
URL: https://github.com/apache/doris/pull/17797

   # Proposed changes
   
   Issue Number: close #17238
   
   ## Problem summary
   
   Describe your changes.
   
   ## Checklist(Required)
   
   * [ ] Does it affect the original behavior
   * [ ] Has unit tests been added
   * [ ] Has document been added or modified
   * [ ] Does it need to update dependencies
   * [ ] Is this PR support rollback (If NO, please explain WHY)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei commented on a diff in pull request #17797: [Enhancement](fe exception) write a java annotation to catch throwable from a method and print log

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei commented on code in PR #17797:
URL: https://github.com/apache/doris/pull/17797#discussion_r1138186631


##########
fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BulkLoadJob.java:
##########
@@ -181,6 +182,7 @@ public Set<String> getTableNamesForShow() {
                 .collect(Collectors.toSet());
     }
 
+    @ExceptionLog

Review Comment:
   using  @LogException instead.



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] morningman commented on pull request #17797: [Enhancement] (fe exception) write a java annotation to catch throwable from a method and print log

Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman commented on PR #17797:
URL: https://github.com/apache/doris/pull/17797#issuecomment-1469017046

   Could you please describe:
   1. How it works?
   2. When to use to?
   3. What is the result when adding this annotation?


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei commented on pull request #17797: [Enhancement](fe exception) write a java annotation to catch throwable from a method and print log

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei commented on PR #17797:
URL: https://github.com/apache/doris/pull/17797#issuecomment-1471710896

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] morningman commented on a diff in pull request #17797: [Enhancement] (fe exception) write a java annotation to catch throwable from a method and print log

Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman commented on code in PR #17797:
URL: https://github.com/apache/doris/pull/17797#discussion_r1136366791


##########
fe/fe-core/src/main/java/org/apache/doris/aspectj/LogAspect.java:
##########
@@ -0,0 +1,50 @@
+// 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.doris.aspectj;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.aspectj.lang.annotation.AfterThrowing;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+@Aspect
+public class LogAspect {
+
+    private static final Logger LOG = LogManager.getLogger(LogAspect.class);
+
+    @Pointcut("@annotation(org.apache.doris.common.annotation.ExceptionLog)")
+    public void throwingLogPointCut() {
+    }
+
+    @AfterThrowing(value = "throwingLogPointCut()", throwing = "e")
+    public void exceptionLog(Exception e)  {
+        LOG.error(e.getMessage());

Review Comment:
   Print 2 logs in one line.
   And do we need to print stack trace for each exception? Maybe we can use a flag to control it?



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei commented on a diff in pull request #17797: [Enhancement](fe exception) write a java annotation to catch throwable from a method and print log

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei commented on code in PR #17797:
URL: https://github.com/apache/doris/pull/17797#discussion_r1138187411


##########
fe/fe-core/src/main/java/org/apache/doris/aspectj/LogAspect.java:
##########
@@ -0,0 +1,64 @@
+// 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.doris.aspectj;
+
+import org.apache.doris.common.annotation.ExceptionLog;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.AfterThrowing;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.reflect.Method;
+
+@Aspect
+public class LogAspect {
+
+    private static final Logger LOG = LogManager.getLogger(LogAspect.class);
+
+    @Pointcut("@annotation(org.apache.doris.common.annotation.ExceptionLog)")
+    public void throwingLogPointCut() {
+    }
+
+    @AfterThrowing(value = "throwingLogPointCut()", throwing = "e")
+    public void exceptionLog(JoinPoint point, Exception e)  {

Review Comment:
   using Throwable intead of Exception,  Exception is only subset of errors.



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] NetShrimp06 commented on a diff in pull request #17797: [Enhancement] (fe exception) write a java annotation to catch throwable from a method and print log

Posted by "NetShrimp06 (via GitHub)" <gi...@apache.org>.
NetShrimp06 commented on code in PR #17797:
URL: https://github.com/apache/doris/pull/17797#discussion_r1136571939


##########
fe/fe-core/src/main/java/org/apache/doris/aspectj/LogAspect.java:
##########
@@ -0,0 +1,50 @@
+// 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.doris.aspectj;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.aspectj.lang.annotation.AfterThrowing;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+@Aspect
+public class LogAspect {
+
+    private static final Logger LOG = LogManager.getLogger(LogAspect.class);
+
+    @Pointcut("@annotation(org.apache.doris.common.annotation.ExceptionLog)")
+    public void throwingLogPointCut() {
+    }
+
+    @AfterThrowing(value = "throwingLogPointCut()", throwing = "e")
+    public void exceptionLog(Exception e)  {
+        LOG.error(e.getMessage());

Review Comment:
   I added a parameter to let the user decide whether to print the stack information, the default is not to print



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei commented on a diff in pull request #17797: [Enhancement](fe exception) write a java annotation to catch throwable from a method and print log

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei commented on code in PR #17797:
URL: https://github.com/apache/doris/pull/17797#discussion_r1138186372


##########
fe/fe-core/src/main/java/org/apache/doris/aspectj/LogAspect.java:
##########
@@ -0,0 +1,64 @@
+// 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.doris.aspectj;
+
+import org.apache.doris.common.annotation.ExceptionLog;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.AfterThrowing;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.reflect.Method;
+
+@Aspect
+public class LogAspect {
+
+    private static final Logger LOG = LogManager.getLogger(LogAspect.class);
+
+    @Pointcut("@annotation(org.apache.doris.common.annotation.ExceptionLog)")
+    public void throwingLogPointCut() {
+    }
+
+    @AfterThrowing(value = "throwingLogPointCut()", throwing = "e")
+    public void exceptionLog(JoinPoint point, Exception e)  {
+        MethodSignature joinPointObject = (MethodSignature) point.getSignature();
+        Method method = joinPointObject.getMethod();
+        ExceptionLog exceptionLog = method.getAnnotation(ExceptionLog.class);
+        LOG.warn(e.getMessage());
+        if (exceptionLog != null && exceptionLog.isGetStackTrace()) {
+            LOG.warn(getStackTrace(e));

Review Comment:
   LOG.warn(e) will print stack trace automatically.



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei commented on a diff in pull request #17797: [Enhancement](fe exception) write a java annotation to catch throwable from a method and print log

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei commented on code in PR #17797:
URL: https://github.com/apache/doris/pull/17797#discussion_r1138188985


##########
fe/fe-core/src/main/java/org/apache/doris/aspectj/LogAspect.java:
##########
@@ -0,0 +1,64 @@
+// 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.doris.aspectj;
+
+import org.apache.doris.common.annotation.ExceptionLog;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.AfterThrowing;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.reflect.Method;
+
+@Aspect
+public class LogAspect {

Review Comment:
   Could you please add another annotation. 
   @NoException
   If a method throws any exceptions, should print log and call system.exit.



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei commented on a diff in pull request #17797: [Enhancement](fe exception) write a java annotation to catch throwable from a method and print log

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei commented on code in PR #17797:
URL: https://github.com/apache/doris/pull/17797#discussion_r1138187411


##########
fe/fe-core/src/main/java/org/apache/doris/aspectj/LogAspect.java:
##########
@@ -0,0 +1,64 @@
+// 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.doris.aspectj;
+
+import org.apache.doris.common.annotation.ExceptionLog;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.AfterThrowing;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.reflect.Method;
+
+@Aspect
+public class LogAspect {
+
+    private static final Logger LOG = LogManager.getLogger(LogAspect.class);
+
+    @Pointcut("@annotation(org.apache.doris.common.annotation.ExceptionLog)")
+    public void throwingLogPointCut() {
+    }
+
+    @AfterThrowing(value = "throwingLogPointCut()", throwing = "e")
+    public void exceptionLog(JoinPoint point, Exception e)  {

Review Comment:
   using Throwable intead of Exception,  Exception is only subset to errors.



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] NetShrimp06 commented on pull request #17797: [Enhancement](fe exception) write a java annotation to catch throwable from a method and print log

Posted by "NetShrimp06 (via GitHub)" <gi...@apache.org>.
NetShrimp06 commented on PR #17797:
URL: https://github.com/apache/doris/pull/17797#issuecomment-1471182016

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] hello-stephen commented on pull request #17797: [Enhancement](fe exception) write a java annotation to catch throwable from a method and print log

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #17797:
URL: https://github.com/apache/doris/pull/17797#issuecomment-1471257414

   TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 33.99 seconds
    stream load tsv:          446 seconds loaded 74807831229 Bytes, about 159 MB/s
    stream load json:         37 seconds loaded 2358488459 Bytes, about 60 MB/s
    stream load orc:          73 seconds loaded 1101869774 Bytes, about 14 MB/s
    stream load parquet:          31 seconds loaded 861443392 Bytes, about 26 MB/s
    https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20230316034752_clickbench_pr_114973.html


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] englefly commented on pull request #17797: [Enhancement](fe exception) write a java annotation to catch throwable from a method and print log

Posted by "englefly (via GitHub)" <gi...@apache.org>.
englefly commented on PR #17797:
URL: https://github.com/apache/doris/pull/17797#issuecomment-1473144140

   it does not work on mac, or newer version of JDK


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #17797: [Enhancement](fe exception) write a java annotation to catch throwable from a method and print log

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #17797:
URL: https://github.com/apache/doris/pull/17797#issuecomment-1471582388

   PR approved by anyone and no changes requested.


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #17797: [Enhancement](fe exception) write a java annotation to catch throwable from a method and print log

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #17797:
URL: https://github.com/apache/doris/pull/17797#issuecomment-1471582303

   PR approved by at least one committer and no changes requested.


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] NetShrimp06 commented on pull request #17797: [Enhancement] (fe exception) write a java annotation to catch throwable from a method and print log

Posted by "NetShrimp06 (via GitHub)" <gi...@apache.org>.
NetShrimp06 commented on PR #17797:
URL: https://github.com/apache/doris/pull/17797#issuecomment-1469393647

   > * How it works?
   >   Aspectj is used to implement the aspect function of annotations. During compilation, the aspectj-maven-plugin plug-in will automatically weave the code added with aspect annotations into the generated classes file.
   > * When to use to?
   >   When a method wants to add a try catch to save exception information, this annotation can be used to automatically capture the exception into the Log file, and the code can be more concise.
   > * What is the result when adding this annotation?
   >   When an exception occurs in the method, the exception information will be recorded in the log file. If you want to print the stack information, you can set the isGetStackTrace parameter of the annotation to true (the default is false to not print the stack information).
   
   


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei merged pull request #17797: [Enhancement](fe exception) write a java annotation to catch throwable from a method and print log

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei merged PR #17797:
URL: https://github.com/apache/doris/pull/17797


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org