Supercharge Your Innovation With Domain-Expert AI Agents!

Log code adding method and device

A log and code technology, applied in the field of log code adding methods and devices, can solve the problems of low efficiency of log code methods

Pending Publication Date: 2021-09-10
BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, for a program, the number of code blocks is large, and the number of code blocks that need to add log codes is also large. The method of manually adding log codes by program developers is inefficient

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
  • Log code adding method and device
  • Log code adding method and device
  • Log code adding method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0051] The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.

[0052] It is inefficient to add log codes to the implementation codes of application programs by applying the existing technology. To solve this technical problem, the embodiments of the present invention provide a method and device for adding log codes.

[0053] In one embodiment of the present invention, a kind of log code adding method is provided, and above-mentioned method comprises:

[0054] Associate a logger for adding logging code to the application;

[0055] Calling the log program to parse the log configuration file to determine the identity of the first target code block to be added in the application program, wherein the log configuration file is used to record the log parameters of the code block to be output in the application program that needs to add code;

[0056] Searching for the fi...

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 invention provides a log code adding method and device, and relates to the technical field of computer software, and the method comprises the following steps: associating a log program for adding a log code to an application program; calling the log program to analyze a log configuration file, and determining an identifier of a first target code block of a to-be-added log code in the application program, wherein the log configuration file is used for recording log parameters of a to-be-output log of the code block of the to-be-added code in the application program; searching the first target code block in implementation codes of the application program according to the identifier of the first target code block; and calling the log program to add log codes for the first target code block according to log parameters recorded in the log configuration file. By applying the scheme provided by the embodiment of the invention to add the log code, the efficiency of adding the log code can be improved.

Description

technical field [0001] The invention relates to the technical field of computer software, in particular to a log code adding method and device. Background technique [0002] In the process of program development, in order to make it easier for program developers to debug the developed program, it is often necessary to add log codes for outputting log information in the code blocks that implement various functions of the program, so that the log codes in the code blocks can be output during the running of the program. Various variables, parameters, etc., the program developer performs program debugging according to the information output above. In different programming languages, the program elements corresponding to the above code blocks are different. For example, the program element corresponding to the above code block may be a class or a function. [0003] In the prior art, generally, a program developer manually adds log codes to add log codes in each code block of th...

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
IPC IPC(8): G06F11/36
CPCG06F11/3624G06F11/3644
Inventor 马仕尊
Owner BEIJING QIYI CENTURY SCI & TECH CO LTD
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More