MCPcopy
hub / github.com/qodo-ai/qodo-cover / log

Method log

cover_agent/lsp_logic/multilspy/multilspy_logger.py:33–65  ·  view source on GitHub ↗

Log the debug and santized messages using the logger

(
        self, debug_message: str, level: int, sanitized_error_message: str = ""
    )

Source from the content-addressed store, hash-verified

31 self.logger.setLevel(logging.INFO)
32
33 def log(
34 self, debug_message: str, level: int, sanitized_error_message: str = ""
35 ) -> None:
36 """
37 Log the debug and santized messages using the logger
38 """
39
40 debug_message = debug_message.replace("'", '"').replace("\n", " ")
41 sanitized_error_message = sanitized_error_message.replace("'", '"').replace(
42 "\n", " "
43 )
44
45 # Collect details about the callee
46 curframe = inspect.currentframe()
47 calframe = inspect.getouterframes(curframe, 2)
48 caller_file = calframe[1][1].split("/")[-1]
49 caller_line = calframe[1][2]
50 caller_name = calframe[1][3]
51
52 # Construct the debug log line
53 debug_log_line = LogLine(
54 time=str(datetime.now().strftime("%Y-%m-%d %H:%M:%S")),
55 level=logging.getLevelName(level),
56 caller_file=caller_file,
57 caller_name=caller_name,
58 caller_line=caller_line,
59 message=debug_message,
60 )
61
62 self.logger.log(
63 level=level,
64 msg=debug_log_line.json(),
65 )

Callers 15

validate_testMethod · 0.80
call_modelMethod · 0.80
read_fileMethod · 0.80
download_fileMethod · 0.80
createMethod · 0.80
logging_fnMethod · 0.80
open_fileMethod · 0.80
get_open_file_textMethod · 0.80
request_definitionMethod · 0.80

Calls 1

LogLineClass · 0.85

Tested by 1

validate_testMethod · 0.64