From 03ee15ece2ff749be8f4c211e1ee6fd3a3a6066d Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期四, 09 二月 2023 14:13:44 +0800
Subject: [PATCH] Merge pull request #741 from gaofuwang/wvp-28181-2.0

---
 src/main/java/com/genersoft/iot/vmp/gb28181/conf/DefaultProperties.java |   37 +++++++++++++++++++++----------------
 1 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/conf/DefaultProperties.java b/src/main/java/com/genersoft/iot/vmp/gb28181/conf/DefaultProperties.java
index 1831f93..3cdf48d 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/conf/DefaultProperties.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/conf/DefaultProperties.java
@@ -12,7 +12,7 @@
  */
 public class DefaultProperties {
 
-    public static Properties getProperties(String ip, boolean isDebug) {
+    public static Properties getProperties(String ip, boolean isDebug, boolean sipLog) {
         Properties properties = new Properties();
         properties.setProperty("javax.sip.STACK_NAME", "GB28181_SIP");
         properties.setProperty("javax.sip.IP_ADDRESS", ip);
@@ -49,23 +49,28 @@
          * sip_server_log.log 鍜� sip_debug_log.log ERROR, INFO, WARNING, OFF, DEBUG, TRACE
          */
         Logger logger = LoggerFactory.getLogger(AlarmNotifyMessageHandler.class);
-        if (logger.isDebugEnabled()) {
-            System.out.println("DEBUG");
-            properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "DEBUG");
-        }else if (logger.isInfoEnabled()) {
-            System.out.println("INFO1");
-            properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "INFO");
-        }else if (logger.isWarnEnabled()) {
-            System.out.println("WARNING");
-            properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "WARNING");
-        }else if (logger.isErrorEnabled()) {
-            System.out.println("ERROR");
-            properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "ERROR");
+        if (sipLog) {
+            if (logger.isDebugEnabled()) {
+                System.out.println("DEBUG");
+                properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "DEBUG");
+            }else if (logger.isInfoEnabled()) {
+                System.out.println("INFO1");
+                properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "INFO");
+            }else if (logger.isWarnEnabled()) {
+                System.out.println("WARNING");
+                properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "WARNING");
+            }else if (logger.isErrorEnabled()) {
+                System.out.println("ERROR");
+                properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "ERROR");
+            }else {
+                System.out.println("INFO2");
+                properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "INFO");
+            }
+            logger.info("[SIP鏃ュ織]绾у埆涓�: {}", properties.getProperty("gov.nist.javax.sip.TRACE_LEVEL"));
         }else {
-            System.out.println("INFO2");
-            properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "INFO");
+            logger.info("[SIP鏃ュ織]宸插叧闂�");
         }
-        logger.info("[SIP鏃ュ織]绾у埆涓�: {}", properties.getProperty("gov.nist.javax.sip.TRACE_LEVEL"));
+
 
 
         return properties;

--
Gitblit v1.8.0