change log level
This commit is contained in:
parent
03bcd6b376
commit
d4938fdbda
@ -2,6 +2,7 @@ import logging, os
|
|||||||
from netmiko import ConnectHandler, NetmikoTimeoutException, NetmikoAuthenticationException
|
from netmiko import ConnectHandler, NetmikoTimeoutException, NetmikoAuthenticationException
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
logger.setLevel(logging.WARNING)
|
||||||
|
|
||||||
# Establish connection to network device
|
# Establish connection to network device
|
||||||
def establish_connection(device_config):
|
def establish_connection(device_config):
|
||||||
|
@ -3,6 +3,7 @@ from functools import wraps
|
|||||||
from flask import request
|
from flask import request
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
logger.setLevel(logging.WARNING)
|
||||||
|
|
||||||
|
|
||||||
# Exception handler
|
# Exception handler
|
||||||
@ -33,7 +34,7 @@ def load_yaml(filename, key=None):
|
|||||||
with open(config_path, 'r') as f:
|
with open(config_path, 'r') as f:
|
||||||
data = yaml.safe_load(f)
|
data = yaml.safe_load(f)
|
||||||
if data is None:
|
if data is None:
|
||||||
logger.warning(f"Empty configuration file: {filename}")
|
logger.error(f"Empty configuration file: {filename}")
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
# Return specific key if provided
|
# Return specific key if provided
|
||||||
|
@ -6,6 +6,7 @@ from app.functions.utils import exception_handler, load_yaml, send_webhook, get_
|
|||||||
from app.functions.netmiko import execute_command
|
from app.functions.netmiko import execute_command
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
logger.setLevel(logging.WARNING)
|
||||||
|
|
||||||
bp = Blueprint('main', __name__)
|
bp = Blueprint('main', __name__)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user