Quellcode durchsuchen

IP解析加日志打印

zhangdongming vor 2 Monaten
Ursprung
Commit
14197115ab
1 geänderte Dateien mit 2 neuen und 0 gelöschten Zeilen
  1. 2 0
      Object/IPWeatherObject.py

+ 2 - 0
Object/IPWeatherObject.py

@@ -255,6 +255,7 @@ class Findip:
         self.country_code = ''
 
         try:
+            LOGGER.info('FindIP解析ip:{}'.format(self.ip))
             # 调用findip API获取IP信息
             self._get_ip_info()
 
@@ -268,6 +269,7 @@ class Findip:
                 'country_code': self.country_code,
                 'is_geoip2': True  # 是否为GeoIP2解析
             }
+            LOGGER.info('FindIP解析ip成功:{}'.format(ip_addr_data))
             IPAddr.objects.create(**ip_addr_data)
 
         except Exception as e: