Logger vs. System.out.println

前端 未结 6 1765
挽巷
挽巷 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:54

    See this short introduction to log4j.

    The issue is in using System.out to print debugging or diagnostic information. It is a bad practice because you cannot easily change log levels, turn it off, customize it, etc.

    However if you are legitimately using System.out to print information to the user, then you can ignore this warning.

提交回复
热议问题