Unlock instant, AI-driven research and patent intelligence for your innovation.

Automatic recording method and system of python function operation information

A technology of running information and automatic recording, applied in the field of data communication, can solve the problems of heavy workload and tediousness, achieve high accuracy, speed up the debugging process, and improve the development efficiency

Active Publication Date: 2017-08-25
TENCENT TECH (SHENZHEN) CO LTD
View PDF2 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] Based on this, it is necessary to provide an automatic recording method and system for Python function operation information in view of the heavy workload and cumbersome problems caused by the manual recording of function operation information.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Automatic recording method and system of python function operation information
  • Automatic recording method and system of python function operation information

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0016] The solution of the present invention will be described in detail below in combination with the preferred embodiments thereof.

[0017] see figure 1 As shown, an automatic recording method of Python function operation information includes the following steps:

[0018] Step S10, judging whether the function in Python that currently needs to record the function operation information is an ordinary function or a class member function. As we all know, functions in Python can be divided into ordinary functions and class member functions. In the embodiments of the present invention, different technologies are adopted for different types of functions to realize automatic recording of function operation information.

[0019] Step S20, if it is an ordinary function, use decorator technology to process it. Specifically, the following steps may be included:

[0020] Step S201, assuming that the ordinary function that needs to record the function running information is A, take ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The embodiment of the present invention provides a method and system for automatically recording Python function operation information. First, it is judged whether the Python function to be processed is an ordinary function or a class member function. Functions are processed using metaclass technology. Through the application of metaclass technology and decorator technology in log processing, the function operation information of Python common functions and class member functions can be automatically recorded, thus solving the problem of traditional manual recording of function operation information. The resulting workload is heavy and cumbersome, which improves the development efficiency and speeds up the debugging process; and because automatic recording is more accurate than manual recording, it reduces the risk of BUG in the log processing part.

Description

technical field [0001] The invention relates to the technical field of data communication, in particular to a method for automatically recording Python function operation information and an automatic recording system for Python function operation information. Background technique [0002] In a Python program, it is necessary to observe whether the processing process of the function meets expectations by recording the information when the function is running. The function running information mainly includes: function name, parameter name, parameter value, return value, etc. At present, in the traditional method of recording function operation information, the function name, parameter name, parameter value, and return value to be recorded by the programmer need to be recorded in each function that needs to be recorded, and when the function has multiple return values When , there are many places that need to be recorded inside the function. [0003] Because in the traditional...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F9/44
Inventor 谢平
Owner TENCENT TECH (SHENZHEN) CO LTD