Logger vs. System.out.println

前端 未结 6 1762
挽巷
挽巷 2020-12-08 01:59

I\'m using the PMD plugin for eclipse and it gives me an error when using System.out.println() with the explanation:

System.(out|err).pri

6条回答
  •  时光取名叫无心
    2020-12-08 02:45

    It appears that PMD is assuming that you are calling System.out.println() for debugging purposes; stuff like "Im in ur method, executing ur codez".

    If you're doing that, you're going to have a much better time writing to a logger like Log4J, as it'll have multiple streaming options than just to screen.

    If, however, you're doing a console application and are calling System.out as part of that, ignore the warning.

提交回复
热议问题