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

A method of decoupling program and log

A log and program technology, applied in the field of software program and log decoupling, can solve problems such as large method limitations, complex configuration files, unfriendly developers, etc., to achieve the effect of good adaptability and practicability

Active Publication Date: 2021-05-11
GUANGDONG EFLYCLOUD COMPUTING CO LTD
View PDF6 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

This method can completely decouple the running log from the main logic of the program, but the method has great limitations. It can only be programmed in the framework provided by it, and it needs to rely on the configuration file. When the program logic becomes complicated, the configuration file will also Correspondingly complicated and unfriendly to developers

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
  • A method of decoupling program and log

Examples

Experimental program
Comparison scheme
Effect test

specific Embodiment approach

[0025]Such asfigure 1As shown, the specific embodiments of the present invention are as follows:

[0026]Step 1, encapsulate the logging logic into a function interface, and design two incoming parameters, parameter one is function name funcname, parameter 2 is a set paramList;

[0027]Step 2, rewrite the function name error handling mechanism, for the function that requires the logging running log, the function name identification to ensure that the programming rule is not conflict with the programming language itself, can increase the prefix in the name Increase the suffix or otherwise. For example, the prefix can be the underline "_", can be a plus "+", or even if the programming language allows, it can be an asterisk "*", or it can be a word, such as "log", but must ensure that the programming rule does not conflict ;

[0028]Step 3, the program master logic corrects the function, when calling, the function name does not have an identity. For example, using the underscore "_" prefix tag ...

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 invention discloses a method for decoupling a program and a log, comprising the steps of: S1, encapsulating the log record logic into a function interface; S2, rewriting the function name error handling mechanism; S3, calling the function by the main logic of the program; S4, judging the function Whether there is a function name error when calling, if yes, go to step 5; otherwise, call the function directly to end; S5, the error handling function captures the exception, and saves the captured function name and input parameters in memory, and calls the logging function to record the log ; S6, the error handling function adds the identifier to the function name, and calls the function again. The present invention solves the problem of log and program coupling by adopting a function name error handling mechanism, so that the code of the main logic of the program and the code of the running log are isolated from each other and do not affect each other. It is recorded, and does not depend on any framework, and has no limitations on programming languages, and has good adaptability and practicability.

Description

Technical field[0001]The present invention relates to the field of software technology, and more particularly to a method of software program and log decoupling.Background technique[0002]Hook: In the project code, it is considered that a hook function is placed (temporarily non-extended) place, etc. When you need to scale, you can implement the implementation class and functions to this hook, you can achieve it.[0003]AOP: Abbreviation for Aspect Oriented Programming. It is intended to facilitate cutting-up programming, a technique for implementing the unified maintenance of program functions by precompilation and running period dynamic proxy.[0004]In the current program development, the logging run log is an essential step, especially on some key main logic code, running the log only can monitor the operation of the program, but also used to analyze when the program is wrong. wrong reason. There are a lot of use of running logs, bringing a lot of convenience to procedures, but runs ...

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): G06F11/34
CPCG06F11/3476
Inventor 叶浩斌史伟霍键聪
Owner GUANGDONG EFLYCLOUD COMPUTING CO LTD