Skip to content

Commit

Permalink
fixxed logger for selenium, and logs location creation
Browse files Browse the repository at this point in the history
  • Loading branch information
dmy.berezovskyi committed Oct 7, 2024
1 parent c323f83 commit 19b4b44
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from utils.event_listener import EventListener
from driver.driver_factory import WebDriverFactory
from utils.logger import Logger, LogLevel
sys.path.append(os.path.join(os.path.dirname(__file__), 'src'))

log = Logger(log_lvl=LogLevel.INFO).get_instance()

Expand Down
4 changes: 2 additions & 2 deletions utils/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __call__(cls, *args, **kwargs):

class Logger(metaclass=Singleton):
def __init__(self, log_lvl=LogLevel.INFO):
self._log = logging.getLogger("appium")
self._log = logging.getLogger("selenium")
self._log.setLevel(LogLevel.DEBUG.value)

formatter = logging.Formatter(
Expand All @@ -36,7 +36,7 @@ def __init__(self, log_lvl=LogLevel.INFO):
def _create_log_file(self):
current_time = time.strftime("%Y-%m-%d")
log_directory = os.path.abspath(
os.path.join(os.path.dirname(__file__), "../src", "tests", "logs")
os.path.join(os.path.dirname(__file__), "../tests", "logs")
)

if not os.path.exists(log_directory):
Expand Down

0 comments on commit 19b4b44

Please sign in to comment.