mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-03 20:30:41 +08:00
Refactor logging system to use custom logger across the codebase
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user