forked from opendxl-community/OpenDXL-RIMalShare
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.py
More file actions
28 lines (21 loc) · 931 Bytes
/
common.py
File metadata and controls
28 lines (21 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""
Common definitions for the TIE DXL Python SDK samples.
This includes the defining the path to the configuration file used to initialize the DXL client
in addition to setting up the logger appropriately.
"""
import os
import logging
# Config file name.
CONFIG_FILE_NAME = "dxlclient.config"
CONFIG_FILE = os.path.dirname(os.path.abspath(__file__)) + "/" + CONFIG_FILE_NAME
# MalShare Config file name.
MS_CONFIG_FILE_NAME = "ms.config"
MS_CONFIG_FILE = os.path.dirname(os.path.abspath(__file__)) + "/" + MS_CONFIG_FILE_NAME
# Enable logging, this will also direct built-in DXL log messages.
# See - https://docs.python.org/2/howto/logging-cookbook.html
log_formatter = logging.Formatter('%(asctime)s %(name)s - %(levelname)s - %(message)s')
console_handler = logging.StreamHandler()
console_handler.setFormatter(log_formatter)
logger = logging.getLogger()
logger.addHandler(console_handler)
logger.setLevel(logging.INFO)