[ 
https://issues.apache.org/jira/browse/CALCITE-4598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17340369#comment-17340369
 ] 

Vladimir Sitnikov commented on CALCITE-4598:
--------------------------------------------

Julian, here's how "benign" println looks like: 
https://github.com/apache/calcite/runs/2514011232?check_suite_focus=true#step:6:539

{noformat}
CalciteSqlOperatorTest > testCurrentUserFunc() STANDARD_OUT
    write; modCount=15

SqlToRelConverterTest > testOverOrderFollowingWindow() STANDARD_OUT
    write; modCount=16
    write; modCount=17

SqlToRelConverterTest > testSelectViewExtendedColumnCollision() STANDARD_OUT
    write; modCount=18
    write; modCount=19

SqlToRelConverterTest > testSelectViewExtendedColumnExtendedCollision() 
STANDARD_OUT
    write; modCount=20
    write; modCount=21

CalciteSqlOperatorTest > testGreaterThanOperator() STANDARD_OUT
    write; modCount=22
    write; modCount=23
    write; modCount=24

SqlToRelConverterTest > testOrderByOrdinalDesc() STANDARD_OUT
    write; modCount=25
{noformat}

It is really really sad to see that in the output.

I agree there might be valid use cases for println, however, I think every 
println usage should have big red warning, so developers don't really commit 
code with pritln.

It is fine to use println for local debugging, however, the build should fail 
so the committer cleans up the code.

> Forbid the use of System.out
> ----------------------------
>
>                 Key: CALCITE-4598
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4598
>             Project: Calcite
>          Issue Type: Improvement
>    Affects Versions: 1.26.0
>            Reporter: Vladimir Sitnikov
>            Priority: Major
>
> System.out.println often results in useless logging which is impossible to 
> disable in the client code.
> We should remove all the uses of System.out.println and add something like 
> jdk-system-out from forbiddenApis or 
> https://errorprone.info/bugpattern/SystemOut
> I'm inclined to errorprone since it provides a clear way to suppress the 
> warning (add annotation).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to