xbase-util 0.4.4__tar.gz → 0.4.5__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {xbase_util-0.4.4 → xbase_util-0.4.5}/PKG-INFO +1 -1
- {xbase_util-0.4.4 → xbase_util-0.4.5}/setup.py +2 -1
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/xbase_util.py +28 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util.egg-info/PKG-INFO +1 -1
- {xbase_util-0.4.4 → xbase_util-0.4.5}/README.md +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/setup.cfg +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/__init__.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/add_column_util.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/dangerous_util.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/db/__init__.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/db/bean/ConfigBean.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/db/bean/CurrentConfigBean.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/db/bean/FlowBean.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/db/bean/TaskTemplateBean.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/db/bean/__init__.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/db/dao/ConfigDao.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/db/dao/CurrentConfigDao.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/db/dao/FlowDao.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/db/dao/TaskTemplateDao.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/db/dao/__init__.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/db/initsqlite3.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/es_db_util.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/esreq.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/geo_util.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/handle_features_util.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/packet_util.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/pcap_util.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util/xbase_constant.py +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util.egg-info/SOURCES.txt +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util.egg-info/dependency_links.txt +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util.egg-info/not-zip-safe +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util.egg-info/top_level.txt +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util_assets/GeoLite2-City.mmdb +0 -0
- {xbase_util-0.4.4 → xbase_util-0.4.5}/xbase_util_assets/arkimeparse.js +0 -0
@@ -3,7 +3,7 @@ from distutils.core import setup
|
|
3
3
|
from setuptools import find_packages
|
4
4
|
|
5
5
|
setup(name="xbase_util",
|
6
|
-
version="0.4.
|
6
|
+
version="0.4.5",
|
7
7
|
description="网络安全基础工具",
|
8
8
|
long_description="包含提取,预测,训练的基础工具",
|
9
9
|
author="xyt",
|
@@ -12,6 +12,7 @@ setup(name="xbase_util",
|
|
12
12
|
packages=find_packages(),
|
13
13
|
url="https://gitee.com/jimonik/xbase_util.git",
|
14
14
|
install_requires=[
|
15
|
+
|
15
16
|
],
|
16
17
|
zip_safe=False,
|
17
18
|
package_data={
|
@@ -1,6 +1,9 @@
|
|
1
1
|
import json
|
2
|
+
import logging
|
2
3
|
import os
|
3
4
|
import re
|
5
|
+
from datetime import datetime
|
6
|
+
from logging.handlers import TimedRotatingFileHandler
|
4
7
|
from urllib.parse import urlparse, parse_qs
|
5
8
|
|
6
9
|
import execjs
|
@@ -427,3 +430,28 @@ def get_project_root(project_name):
|
|
427
430
|
return f"{current_directory}{os.sep}"
|
428
431
|
current_directory = os.path.dirname(current_directory)
|
429
432
|
return None
|
433
|
+
|
434
|
+
|
435
|
+
def setup_logger(process_name, dir):
|
436
|
+
logger = logging.getLogger(process_name)
|
437
|
+
logger.setLevel(logging.DEBUG) # 设置日志级别
|
438
|
+
log_filename = check_path(f"{dir}/{process_name}.log")
|
439
|
+
handler = TimedRotatingFileHandler(
|
440
|
+
log_filename,
|
441
|
+
when="midnight",
|
442
|
+
interval=1,
|
443
|
+
backupCount=30,
|
444
|
+
encoding="utf-8"
|
445
|
+
)
|
446
|
+
|
447
|
+
def custom_namer(filename):
|
448
|
+
base, ext = os.path.splitext(os.path.splitext(filename)[0])
|
449
|
+
current_time = datetime.now().strftime("_%Y_%m_%d")
|
450
|
+
return f"{base}{current_time}{ext}"
|
451
|
+
|
452
|
+
handler.namer = custom_namer
|
453
|
+
handler.setLevel(logging.DEBUG)
|
454
|
+
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
|
455
|
+
handler.setFormatter(formatter)
|
456
|
+
logger.addHandler(handler)
|
457
|
+
return logger
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|