From 9e15f9fccba6d7a5d997e8ce83d94808e15689be Mon Sep 17 00:00:00 2001 From: Jeroen van Bemmel Date: Wed, 6 Dec 2023 16:20:14 +0000 Subject: [PATCH] Remove custom logging config --- napalm_sros/sros.py | 5 ++--- napalm_sros/utils/utils.py | 12 ------------ 2 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 napalm_sros/utils/utils.py diff --git a/napalm_sros/sros.py b/napalm_sros/sros.py index f405725..cb1e260 100644 --- a/napalm_sros/sros.py +++ b/napalm_sros/sros.py @@ -24,7 +24,6 @@ import json import time import re -import logging import datetime import traceback import xmltodict @@ -56,11 +55,11 @@ GET_IPV6_NEIGHBORS_TABLE,GET_LLDP_NEIGHBORS,GET_LLDP_NEIGHBORS_DETAIL, \ GET_NETWORK_INSTANCES,GET_NTP_PEERS,GET_NTP_SERVERS,GET_OPTICS, \ GET_PROBES_CONFIG,GET_ROUTE_TO,GET_SNMP_INFORMATION,GET_USERS -from napalm_sros.utils.utils import init_logging from .api import get_bgp_neighbors, get_bgp_neighbors_detail +import logging -log = init_logging() +log = logging.getLogger(__file__) class NokiaSROSDriver(NetworkDriver): """Napalm driver for Skeleton.""" diff --git a/napalm_sros/utils/utils.py b/napalm_sros/utils/utils.py deleted file mode 100644 index 7cd6e40..0000000 --- a/napalm_sros/utils/utils.py +++ /dev/null @@ -1,12 +0,0 @@ -import logging -from datetime import datetime - -LOG_FORMAT = '%(asctime)-15s %(filename)s %(funcName)s line %(lineno)d %(levelname)s: %(message)s' - - -def init_logging(): - date = datetime.now() - new_date = date.strftime('%Y-%m-%d %H.%M.%S') - file_path = "./logs_{}.log".format(new_date) - logging.basicConfig(filename=file_path, format=LOG_FORMAT, level=logging.DEBUG) - return logging.getLogger()