From 1417d9d9fa363ebe4b796b26a061823060bd5d6e Mon Sep 17 00:00:00 2001 From: lilei Date: Tue, 28 May 2019 16:30:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=8D=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E7=9A=84=E6=97=A5=E5=BF=97=E4=BB=A3=E7=A0=81=E6=88=96=E8=80=85?= =?UTF-8?q?=E8=B0=83=E8=AF=95=E6=97=B6=E6=B7=BB=E5=8A=A0=E7=9B=91=E8=A7=86?= =?UTF-8?q?=E9=83=BD=E4=BC=9A=E5=AF=BC=E8=87=B4=E4=B8=9A=E5=8A=A1=E5=87=BA?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- java/DangerLog.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 java/DangerLog.java diff --git a/java/DangerLog.java b/java/DangerLog.java new file mode 100644 index 0000000..555a6c8 --- /dev/null +++ b/java/DangerLog.java @@ -0,0 +1,19 @@ +public class DangerLog { + public class ReadLog { + int readNum; + + @Override + public String toString() { + // 调用该方法将对象的状态,打印或者调试都可能会调用该方法 + readNum++; + return "ReadLog [readNum:" + readNum + ",其他信息]"; + } + } + + public ReadLog getReadLog() { + ReadLog log = new ReadLog(); + // 删除下面不需要的日志代码或者调试时添加监视都会导致业务出错 + System.out.println(log); + return log; + } +} -- Gitee