Refactor logging system to use custom logger across the codebase

This commit is contained in:
Ori Kotek
2023-10-16 14:56:00 +03:00
parent 41166dc271
commit c324d88be3
32 changed files with 340 additions and 311 deletions

View File

@ -1,4 +1,3 @@
import logging
from abc import ABC, abstractmethod
from dataclasses import dataclass
@ -6,6 +5,8 @@ from dataclasses import dataclass
from enum import Enum
from typing import Optional
from pr_agent.log import get_logger
class EDIT_TYPE(Enum):
ADDED = 1
@ -136,7 +137,7 @@ def get_main_pr_language(languages, files) -> str:
"""
main_language_str = ""
if not languages:
logging.info("No languages detected")
get_logger().info("No languages detected")
return main_language_str
try:
@ -172,7 +173,7 @@ def get_main_pr_language(languages, files) -> str:
main_language_str = top_language
except Exception as e:
logging.exception(e)
get_logger().exception(e)
pass
return main_language_str