Commit 7ba2b28c by Qubad786

Fix logging issues.

parent cd0b4495
...@@ -28,6 +28,8 @@ def get_logger_config(log_dir='/var/tmp', ...@@ -28,6 +28,8 @@ def get_logger_config(log_dir='/var/tmp',
if local_loglevel not in ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']: if local_loglevel not in ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']:
local_loglevel = 'INFO' local_loglevel = 'INFO'
console_loglevel = 'DEBUG' if debug else 'INFO'
hostname = platform.node().split(".")[0] hostname = platform.node().split(".")[0]
syslog_format = ( syslog_format = (
"[service_variant={service_variant}]" "[service_variant={service_variant}]"
...@@ -39,10 +41,7 @@ def get_logger_config(log_dir='/var/tmp', ...@@ -39,10 +41,7 @@ def get_logger_config(log_dir='/var/tmp',
logging_env=logging_env, hostname=hostname logging_env=logging_env, hostname=hostname
) )
if debug: handlers = ['console', 'local']
handlers = ['console']
else:
handlers = ['local']
logger_config = { logger_config = {
'version': 1, 'version': 1,
...@@ -62,7 +61,7 @@ def get_logger_config(log_dir='/var/tmp', ...@@ -62,7 +61,7 @@ def get_logger_config(log_dir='/var/tmp',
}, },
'handlers': { 'handlers': {
'console': { 'console': {
'level': 'DEBUG' if debug else 'INFO', 'level': console_loglevel,
'class': 'logging.StreamHandler', 'class': 'logging.StreamHandler',
'formatter': 'standard', 'formatter': 'standard',
'stream': sys.stdout, 'stream': sys.stdout,
......
...@@ -9,8 +9,6 @@ import datetime ...@@ -9,8 +9,6 @@ import datetime
import yaml import yaml
from VEDA.utils import get_config from VEDA.utils import get_config
LOGGER = logging.getLogger(__name__)
requests.packages.urllib3.disable_warnings() requests.packages.urllib3.disable_warnings()
...@@ -36,6 +34,8 @@ Send data to VAL, either Video ID data or endpoint URLs ...@@ -36,6 +34,8 @@ Send data to VAL, either Video ID data or endpoint URLs
from control_env import * from control_env import *
from control.veda_utils import ErrorObject, Output from control.veda_utils import ErrorObject, Output
LOGGER = logging.getLogger(__name__)
class VALAPICall(): class VALAPICall():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment