feat(conftest): set log level using LOG_LEVEL env var
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
920b54e94c
commit
6418fcd6c6
|
@ -1,6 +1,7 @@
|
||||||
import logging
|
import logging
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
import os
|
||||||
import allure
|
import allure
|
||||||
import pytest
|
import pytest
|
||||||
from PIL import ImageGrab
|
from PIL import ImageGrab
|
||||||
|
@ -13,7 +14,7 @@ from scripts.utils.system_path import SystemPath
|
||||||
# Send logs to pytest.log as well
|
# Send logs to pytest.log as well
|
||||||
handler = logging.FileHandler(filename=configs.PYTEST_LOG)
|
handler = logging.FileHandler(filename=configs.PYTEST_LOG)
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=logging.DEBUG,
|
level=os.getenv('LOG_LEVEL', 'INFO'),
|
||||||
format='[%(asctime)s] (%(filename)18s:%(lineno)-3s) [%(levelname)-7s] --- %(message)s',
|
format='[%(asctime)s] (%(filename)18s:%(lineno)-3s) [%(levelname)-7s] --- %(message)s',
|
||||||
handlers=[handler],
|
handlers=[handler],
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue