CN109471773B - Method, device, server and storage medium for multi-channel output of front-end log - Google Patents

Method, device, server and storage medium for multi-channel output of front-end log Download PDF

Info

Publication number
CN109471773B
CN109471773B CN201811287809.1A CN201811287809A CN109471773B CN 109471773 B CN109471773 B CN 109471773B CN 201811287809 A CN201811287809 A CN 201811287809A CN 109471773 B CN109471773 B CN 109471773B
Authority
CN
China
Prior art keywords
log
output
driver
level
unified
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811287809.1A
Other languages
Chinese (zh)
Other versions
CN109471773A (en
Inventor
姚尧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201811287809.1A priority Critical patent/CN109471773B/en
Publication of CN109471773A publication Critical patent/CN109471773A/en
Application granted granted Critical
Publication of CN109471773B publication Critical patent/CN109471773B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3624Software debugging by performing operations on the source code, e.g. via a compiler
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to a method, a device, a server and a storage medium for multi-channel output of a front-end log. The expansibility of the log device is greatly improved, and more log scenes are provided.

Description

Method, device, server and storage medium for multi-channel output of front-end log
Technical Field
The invention relates to the technical field of computer front-end development, in particular to a method, a device, a server and a storage medium for multi-channel output of a front-end log.
Background
At present, most front-end developers can directly print logs in a program to a console in the development process, the log printing lacks a uniform outlet, and a log switch is not set through the uniform outlet. On the premise of no log switch, program calculation is frequent, and the problem of great reduction of front-end performance occurs in a scene with more log printing, namely program calculation and IO output are required.
Disclosure of Invention
In view of the problems in the prior art, an object of the present invention is to provide a method, an apparatus, a server and a storage medium for multi-channel output of a front-end log, which provide a unified outlet for all log information, provide a log switch, a log level control and a log output method, define a log driver by a driver, and provide a set of standards for a log driver interface and standard implementation.
In order to achieve the above object, the technical solution adopted by the present invention is a method for front-end log multi-channel output, the method comprising the steps of:
s1, defining a log driving abstract class of the front-end browser, providing unified standards of log driving of different levels, and realizing log output by using a log driver according to the unified standards;
s2, defining different levels of log output unified exit classes, and unifying the log output ports of different levels to control the log level output at the unified log exit; and S3, calling the log driver and outputting the log information in a unified manner.
In the above technical solution, in the step S1, a log driver is used to extend the new log, and the log driver needs to inherit the uniform standard of the log driver abstract class to realize the new log driver output.
In the above technical solution, the log level setting function is SetLevel, and is configured to set a log printing level, where the log level is set according to priority, and when a log is printed, the log to be printed is a set current-level log and a log below the current level. In the foregoing technical solution, in step S2, the log driver setting function is SetDriver, and when the log driver is used to set the log loading driver, the output of the corresponding log is implemented according to the log driver. In the foregoing technical solution, in the step S2, during the log level output control, each log performs level judgment during an output process, and if the log is greater than the currently set log level, the log is not output. .
In the above technical solution, the driver invoked in step S3 includes an instantiation log driver and a log unified output exit driver.
In the technical scheme, the method further comprises the step of setting a log switch outside, wherein the log switch is used for controlling the log to be printed outside, adding a log parameter after the URL loaded in the address bar of the browser is passed, setting the log level after the browser identifies, and outputting the log of the corresponding level after the log level setting is finished.
The invention discloses a device for multi-channel output of a front-end log, which comprises a first definition module, a second definition module and a calling output module;
the first definition module is used for defining a log driving abstract class of a front-end browser, providing unified standards of log driving of different levels, and realizing log output by using a log driver according to the unified standards; the second definition module is used for defining the log output unified outlet classes of different levels, unifying the log output ports of different levels and controlling the log level output at the unified log outlet; and the calling output module is used for calling the log driver and uniformly outputting the log information.
The invention discloses a server of a front-end log multichannel output device, which comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, wherein the processor realizes the steps of any one of the methods for front-end log multichannel output when executing the computer program.
The invention discloses a computer readable storage medium, which stores a computer program, and the computer program realizes the steps of any one of the methods for front-end log multi-channel output when being executed by a processor.
The invention discloses a front-end log multichannel output method, a device, a server and a storage medium, which have the following beneficial effects: the invention provides various log drivers to realize a log multi-export strategy, can effectively increase the diversity of JS logs, provides a plurality of log drivers for selection required by actual development, and can integrate debugging modes including console logs, page logs, remote logs and the like. The expansibility of the log device can be greatly improved, and the possibility is provided for more log scenes.
Drawings
Fig. 1 is a flowchart of a front-end log multi-channel output method according to an embodiment of the present invention;
FIG. 2 is a block diagram of a front-end log multi-channel output device according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a server according to a third embodiment of the present invention.
Detailed Description
The invention provides a method and a device for multi-channel output of a front-end log, a server and a storage medium.
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention as shown in fig. 1 provides a front-end log multi-channel output method, which includes the following steps, as shown in fig. 1:
s1, defining a log driving abstract class of the front-end browser, providing unified standards of log driving of different levels, and realizing log output by using a log driver according to the unified standards; in the abstract class, in the object-oriented concept, all objects are described by classes, but in the reverse, not all classes are used for describing objects, if a class does not contain enough information to describe a specific object, such a class is an abstract class, the abstract class cannot instantiate objects, other functions of the class still exist, and the access modes of member variables, member methods and construction methods are the same as those of a common class. Since abstract classes cannot instantiate objects, abstract classes must be inherited to be used. Parent classes contain common methods of subclass aggregation, but since parent classes are themselves abstract, these methods cannot be used.
The debugging in the development process of the front-end browser is an inevitable process, a plurality of browsers can be selected, but if the platform browser needing debugging has problems, great problems are brought to program debugging, so that the log is necessary to be output immediately, and the user can know where the program covers. Under the complex network environment and browser environment, self-test, QA test and Code Review are not enough, if the requirements on page stability and accuracy are high, a complete Code exception monitoring system is required, and a method and a problem for monitoring front-end Code exception are required to be set out, so that the possible obstacles and processing schemes in each stage of error log collection are explained as fully as possible.
Wherein, since there is no concept of interface in javascript ecmascript6, an abstract class is used instead, named AbsLogDriver, which provides 5 different levels of LOG output methods and completes 5 different levels of LOG output, the 5 levels of LOGs respectively specify for INFO messages that can highlight information about the running condition of an application at a coarse level, LOG, DEBUG, specify that fine-grained information events are the most useful application debugging, WARN specifies that potentially harmful conditions exist, ERROR events may still allow the application to continue to run, and for the standard levels, the relationship is as follows: DEBUG < INFO < WARN < ERROR. The DEBUG level is lowest, any things which are beneficial to know the running state of the system in more detail during debugging can be used freely, INFO important output information is used for feeding back the current state of the system to the heaviest users, the WARN can be repaired, the system can continue to run, and the ERROR can be repaired, but the normal work of the system cannot be confirmed.
The JavaScript is an object-oriented dynamic language, which comprises types, operators, standard built-in (build-in) objects and methods. Its syntax is derived from Java and C, so many of the syntax characteristics of both languages are equally applicable to JavaScript. One major difference to note is that class is not supported by JavaScript, and the concept of class is continued in JavaScript by object prototypes (object prototypes). Another major difference is that functions in JavaScript are also objects, which allows functions to be passed like other objects while containing executable code. The core of JavaScript is to support object-oriented, while it also provides powerful and flexible OOP language capabilities. Object-oriented programming is a programming model that creates real-world models in an abstract way. It uses several techniques, including modular, multi-modal and encapsulated, that were previously established. Today, many popular programming languages (e.g., Java, JavaScript, C #, C + +, Python, PHP, Ruby, and Objective-C) support object-oriented programming (OOP). Versus "a program being just a collection of functions, or a simple list of computer instructions. "in terms of traditional software design concepts, object-oriented programming can be viewed as software design that uses a series of objects to cooperate with each other. In OOP, each object is capable of receiving messages, processing data, and sending messages to other objects. Each object can be viewed as an independent small machine with a clear role or responsibility. The object oriented programming aims to promote better flexibility and maintainability in programming, which is widely prevalent in large software projects. By virtue of its emphasis on modularization, object-oriented code development is simpler and easier to understand, and it is more straightforward to analyze, encode and understand complex situations and processes than non-modular programming approaches.
The Interface is called Interface in English, and in software engineering, the Interface generally refers to a method or a function called by others. It is an abstraction of behavior and may contain variables and methods in the interface. An interface is an extremely abstract type that is more "abstract" than abstract classes, and variables are not generally defined in the interface.
The Abstract class can provide the implementation details of the member method, and only a Public Abstract method can exist in an interface; the member variables in the abstract class can be of various types, and the member variables in the interface can only be of the Public Static Final type; the interface can not contain a static code block and a static method, and the abstract class can contain the static code block and the static method; a class can inherit only one abstract class, whereas a class can implement multiple interfaces. An abstract class is an abstraction of a thing, i.e. a class abstraction, and an interface is an abstraction of a behavior. The abstract class is used for abstracting the whole class, including attributes and behaviors, but the interface is used for abstracting part (behaviors) of the class. The design level is different, and the abstract class is used as a parent class of a plurality of subclasses and is a template type design. The interface is a behavior specification, which is a radiation type design, and for abstract classes, if a new method needs to be added, concrete implementation can be directly added in the abstract classes, and subclasses can not be changed; however, the interface is not the same, and if the interface is changed, all classes implementing the interface must be changed accordingly.
The INFO is used for printing normal state information which should appear in a program, and is convenient for tracking and positioning; WARN indicates that the system is slightly unreasonable but does not affect operation and use; ERROR indicates that a system ERROR and an exception occur, and the target operation cannot be completed normally.
The error log format may be:
log.error ("[ interface name or operation name ] [ Some Error Msg ] happens. [ params ] [ Probaby Because ] [ Probaby need to do ]");
log.error (string.format ("[ interface name or operation name ] [ Some Error Msg ] happens. [% s ] - [ basic Because ] - [ basic need to do ]", params)); or
log Error ("[ Some Error Msg ] happens to Error parameter or content while [ in Some condition ] - [ basic needed to do ]);
log.error(String.format(“[Some Error Msg]happens to%s when[in some condition].[Probably Because].[Probably need to do].”,parameters));
[ Probably Reason ] [ Probably needed to do ]. can be omitted in some cases;
each error log is independent, and as complete, concrete and direct as possible, describes what errors occur under what kind of scenes, and what measures or steps are taken due to what causes.
Error logs are one of the important means of troubleshooting problems. When programming to implement a function, it is common to consider various errors that may occur and the corresponding causes:
to investigate the corresponding cause, some key descriptions are needed to locate the cause. This will form a triplet: error phenomena- > error key description- > final error cause.
It is desirable to provide as many respective error critical descriptions as possible for each error in order to locate the respective cause of the error.
Optionally, in step S1, a log driver is used to extend the new log, and the log driver needs to inherit the uniform standard of the log driver abstract class to realize the new log driver output. Specifically, a new log is expanded, the log driving abstract class is inherited, and the log output method of different levels defined in the log driving abstract class is covered. The inheritance creates an object according to the existing class, does not change the existing class, and adds new codes into the object in the form of the existing class; the advantage of inheritance is that subclasses can overwrite parent methods to facilitate extension of parent classes.
If a driver based on the console output LOG is realized and named Console LogDriver, the driver inherits the LOG abstract class during running, and covers the INFO, LOG, DEBUG, WARN and ERROR in the embodiment, 5 LOGs with different levels are covered, if the LOG driver needs to print on the console, the LOG driver needs to output the LOG under the console, and the LOG driver can be quickly and effectively expanded through a driver mode.
S2, defining different levels of log output unified exit classes, and unifying the log output ports of different levels to control the log level output at the unified log exit; optionally, a driver LogDriver and a current log level LogLevel are defined, the log level setting function is SetLevel and is used for setting a log printing level, the log level is set according to a priority, and when the log is printed, the printed log is the set current level log and a log below the current level. The priority of the log information, the output destination of the log information and the output format of the log information. The priority of the log information is ERROR, WARN, INFO and DEBUG from high to low, which are respectively used for specifying the importance degree of the log information; the output destination of the log information specifies whether the log is to be printed in a console or a file; and the output format controls the display content of the log information. And using a configuration file of a setlevel (level) method, and setting a log level through the configuration file.
Specifically, the log level configuration can be divided into 3 types, one type of configuration is a log level for configuring a parent type log recorder as above, the second type is a log level for configuring a child type log recorder, and the third type is a log level for configuring an output source (console, file, etc.). Their log-level resolution priorities are ranked from low to high. For example:
1. if the log level (supposing an INFO level) of a parent logger (rootLogger) is configured (and also has to be configured), the log level of a child logger is not configured, and the log level of an output source is not configured, the output source can only output the INFO level or more;
2. if the log level (supposing an INFO level) of a parent log recorder (rootLogger) is configured (and must be configured), the log level (supposing a DEBUG level) of a child log recorder is configured, and the log level of an output source is not configured, the output source outputs the DEBUG level or higher;
3. if the log level (assumed to be INFO level) of the parent logger (rootLogger) is configured (and must be configured as well), the log level (assumed to be DEBUG level) of the child logger is configured, and the log level (assumed to be INFO level) of the output source is configured, the output source outputs the INFO level or higher;
4. if the log level (supposing to be INFO level) of the parent logger (rootLogger) is configured (and must be configured as well), the log level of the child logger is not configured, and the log level (supposing to be DEBUG level) of the output source is configured, the output source outputs the INFO level or more;
thus, from the above example, it can be seen that there are 2 logical relationships between the logger and the output source output log level:
1. if the output source does not define a log level, it inherits the log level of the child log recorder closest to it; a child class logger does not define a log level, and it inherits the parent class logger closest to it.
2. When the journal is printed, the output source compares the journal level defined by the output source with the journal level defined by the subclass journal recorder closest to the output source, if the level defined by the output source is higher than the subclass journal recorder, the journal is output according to the journal level defined by the output source, otherwise, the journal is output according to the journal level of the subclass journal recorder.
Optionally, the log driver setting function is SetDriver, and when the log driver function is used to set the log loading driver, output of the corresponding log is implemented according to the log driver.
Optionally, during the log level output control, each log performs level judgment in the output process, and if the log is higher than the currently set log level, the log is not output.
For example, in the INFO method, the rank determination is: if (levels. info > currLevel) return.
And S3, calling the log driver and outputting the log information in a unified manner.
Optionally, the driver invoked in step S3 includes an instantiation log driver and a log unified output exit driver. Specifically, the instantiation log driver constConsole LogDriver ═ new Console LogDriver (), and the log unified export loads the specific driver Log.
Specific console.log is used for outputting common information, console.info is used for outputting suggestive information, console.error is used for outputting error information, console.wan is used for outputting warning information, and console.debug is used for outputting debugging information.
Specifically, Console is a Console window enhancement for the Console, which is Windows. The console functions include: multiple tags, text editors (e.g., text selection), different types of backgrounds, transparency of letters and colors, configurable fonts, different window styles, and so on, can be cumbersome for a front-end developer to use when monitoring values of certain expressions or variables during development, and instead output the values to a console for debugging. The most common statement is Console log (expression), and there are many other methods for a Console object besides Console log () which is the most commonly used method by developers.
Placeholders may be used for five direct output methods on a Console object, Console. log (), Console. ward (), Console. error (), Console. exception () (equivalent to Console. error ()) and Console. info (). There are four types of placeholders supported, namely characters (% s), integers (% d or% i), floating point numbers (% f), and objects (% o).
Optionally, the method further includes setting a log switch outside, which is used to control the log to be printed outside, adding a log parameter after the URL is loaded in the address bar of the browser, setting the log level after the browser identifies, and outputting the log at the corresponding level after the log level setting is completed.
The URL is a uniform resource locator, namely a character string representing the position of the resource, and the corresponding resource can be accessed by inputting the URL to an address bar of the browser.
Setting Log level according to queryString
Figure BDA0001849455580000121
Querystring is a query string, and generally analyzes data carried by an Http request. The Querystring module provides 4 methods, which 4 methods are corresponding.
The 4 methods are, respectively, query, meaning that a string is deserialized into an object, query, meaning that an object is serialized into a string, as opposed to query.
Const command, Const asserts a read-only constant. The value of the constant cannot be changed. The variables declared by Const must not change value.
The second embodiment of the present invention provides a device for multi-channel output of a front-end log as shown in fig. 2, where the device includes a first definition module, a second definition module, and a retrieval output module;
the system comprises a first definition module, a second definition module and a third definition module, wherein the first definition module is used for defining a log driving abstract class of a front-end browser, providing a unified standard of log driving of different levels, and realizing log output by using a log driver according to the unified standard;
the second definition module is used for defining the log output unified outlet classes of different levels, unifying the log output ports of different levels and controlling the log level output at the unified log outlet; and the calling output module is used for calling the log driver and uniformly outputting the log information.
Fig. 3 shows a schematic structural diagram of a server of a device for multichannel output of a front-end log, in an embodiment of the present invention, where the server in the embodiment includes: a processor 30, a memory 31 and a computer program 32 stored in said memory 31 and executable on said processor 30. The steps of the above-described method embodiments are implemented when the processor 30 executes the computer program 32, and the functions of the modules of the above-described apparatus embodiments are implemented when the processor 30 executes the computer program 32.
The server of the front-end log multichannel output device may be a computing device such as a desktop computer, a notebook, a palm computer, a cloud server, and the like, and the server of the front-end log multichannel output device may include, but is not limited to, a processor 30 and a memory 31. Fig. 3 is only an example of the server, and does not constitute a limitation to the server, and may include more or less components than those shown, or combine some components, or different components, and the server of the apparatus for front-end log multi-channel output may further include an input-output device 33, a display device 34, and the like.
The processor 30 may be a central processing unit, but may also be other general purpose processors, digital signal processors, application specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 31 may be an internal storage unit, a hard disk or a memory of a server of the front-end log multichannel output device. The memory 31 may also be an external storage device of the server, or a plug-in hard disk, a smart card, a secure digital card, a flash memory card, etc. may be provided.
Further, the memory 31 may also include both an internal storage unit of the server and an external storage device. The memory 31 is used for storing the computer program and other programs and data required by the electronic device. The memory 31 may also be used to temporarily store data that has been output or is to be output.
The input/output device 33 may be used to receive input numeric or character information, and specifically, the input/output device 33 may further include one or more of a keyboard, a mouse, a joystick, and the like.
The display device 34 may be used to display information input by the user or various menus provided to the user and the terminal, and the display device 34 may include a display panel, and optionally, a liquid crystal display.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the system described above may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
Those of ordinary skill in the art will appreciate that the modules, method steps, and so forth of the various embodiments described in connection with the embodiments disclosed herein can be implemented as electronic hardware, or combinations of computer software and electronic hardware. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (9)

1. A method for multi-channel output of front-end logs, the method comprising the steps of:
s1, defining a log driving abstract class of the front-end browser, providing unified standards of log driving of different levels, and realizing log output by using a log driver according to the unified standards;
s2, defining different levels of log output unified exit classes, and unifying the log output ports of different levels to control the log level output at the unified log exit;
s3, calling a log driver, and uniformly outputting log information;
in step S1, a log driver is used to expand the new log, and the log driver needs to inherit the uniform standard of the log driver abstract class to realize the new log driver output.
2. The method for multi-channel output of front-end logs according to claim 1, wherein in step S2, the log level setting function is SetLevel, which is used to set a log printing level, wherein the log level is set according to priority, and when a log is printed, the log to be printed is a log with a current level set and a log below the current level.
3. The method for multi-channel output of front-end logs according to claim 2, wherein in step S2, the log driver setting function is SetDriver, and when the log driver is set by the log driver setting function, the output of the corresponding log is implemented according to the log driver.
4. The method for multi-channel output of front-end logs according to claim 3, wherein in the step S2, during the log level output control, each log performs level judgment during output, and if the log is higher than the currently set log level, the log is not output.
5. The method for front-end log multi-channel output according to claim 1, wherein the driver invoked in step S3 includes an instantiated log driver and a log unified output outlet driver.
6. The method for multi-channel output of the front-end log according to claim 1, further comprising setting a log switch outside for controlling the log to be printed outside, adding a log parameter after the URL loaded by the browser address bar is passed, setting a log level after the browser identifies, and outputting the log of the corresponding level after the log level setting is completed.
7. The device for the multichannel output of the front-end log is characterized by comprising a first definition module, a second definition module and a retrieval output module;
the system comprises a first definition module, a second definition module and a third definition module, wherein the first definition module is used for defining a log driving abstract class of a front-end browser, providing a unified standard of log driving of different levels, and realizing log output by using a log driver according to the unified standard; the second definition module is used for defining the log output unified outlet classes of different levels, unifying the log output ports of different levels and controlling the log level output at the unified log outlet; the calling output module is used for calling the log driver and uniformly outputting the log information;
the first definition module extends a new log by using a log driver, and the log driver needs to inherit the uniform standard of the log driver abstract class to realize the drive output of the new log.
8. A server of an apparatus for front-end log multi-channel output, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the steps of a method for front-end log multi-channel output as claimed in any one of claims 1 to 6.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of a method for front-end log multi-channel output according to any one of claims 1 to 6.
CN201811287809.1A 2018-10-31 2018-10-31 Method, device, server and storage medium for multi-channel output of front-end log Active CN109471773B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811287809.1A CN109471773B (en) 2018-10-31 2018-10-31 Method, device, server and storage medium for multi-channel output of front-end log

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811287809.1A CN109471773B (en) 2018-10-31 2018-10-31 Method, device, server and storage medium for multi-channel output of front-end log

Publications (2)

Publication Number Publication Date
CN109471773A CN109471773A (en) 2019-03-15
CN109471773B true CN109471773B (en) 2022-04-12

Family

ID=65666395

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811287809.1A Active CN109471773B (en) 2018-10-31 2018-10-31 Method, device, server and storage medium for multi-channel output of front-end log

Country Status (1)

Country Link
CN (1) CN109471773B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110780857B (en) * 2019-10-23 2024-01-30 杭州涂鸦信息技术有限公司 Unified log component
CN110928753A (en) * 2019-11-19 2020-03-27 深圳前海环融联易信息科技服务有限公司 Method and device for controlling log output of browser console, computer equipment and computer readable storage medium
CN110990050B (en) * 2019-11-25 2023-10-13 泰康保险集团股份有限公司 Model attribute value printing control method, device, medium and equipment
CN111581051A (en) * 2020-04-21 2020-08-25 深圳震有科技股份有限公司 System operation log processing method, device, equipment and medium based on web front end
CN113760844A (en) * 2020-06-01 2021-12-07 武汉斗鱼鱼乐网络科技有限公司 Method and device for fusing multiple log modules
CN111782474A (en) * 2020-06-30 2020-10-16 广东小天才科技有限公司 Log processing method and device, electronic equipment and medium
CN112988511B (en) * 2021-03-12 2023-02-21 山东英信计算机技术有限公司 Log information collection method, system, storage medium and equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1534449A (en) * 2003-03-31 2004-10-06 Peripheral equipment driving program maintenance method of network peripheral equipment
CN105573900A (en) * 2015-12-17 2016-05-11 南京亚派科技股份有限公司 System log configuring and recording method
CN106844156A (en) * 2017-01-24 2017-06-13 武汉虹信技术服务有限责任公司 WCF communication informations hold-up interception method in intelligent building comprehensive management platform system
CN107577577A (en) * 2017-09-13 2018-01-12 郑州云海信息技术有限公司 Method, apparatus, system and the computer-readable recording medium of log-rank printing

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070265779A1 (en) * 2006-05-15 2007-11-15 Filip Misovski Estimating development of new user interface

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1534449A (en) * 2003-03-31 2004-10-06 Peripheral equipment driving program maintenance method of network peripheral equipment
CN105573900A (en) * 2015-12-17 2016-05-11 南京亚派科技股份有限公司 System log configuring and recording method
CN106844156A (en) * 2017-01-24 2017-06-13 武汉虹信技术服务有限责任公司 WCF communication informations hold-up interception method in intelligent building comprehensive management platform system
CN107577577A (en) * 2017-09-13 2018-01-12 郑州云海信息技术有限公司 Method, apparatus, system and the computer-readable recording medium of log-rank printing

Also Published As

Publication number Publication date
CN109471773A (en) 2019-03-15

Similar Documents

Publication Publication Date Title
CN109471773B (en) Method, device, server and storage medium for multi-channel output of front-end log
CN109542399B (en) Software development method and device, terminal equipment and computer readable storage medium
US9886268B1 (en) Dual programming interface
US8418134B2 (en) Method for efficiently managing property types and constraints in a prototype based dynamic programming language
US20210232630A1 (en) Methods and systems for creating networks
US6139198A (en) System and method for enabling tracing of program execution in an object-oriented system
CN108170425B (en) Program code modification method and device and terminal equipment
US6925632B2 (en) System for configuration programming
CN1828597A (en) Styling mechanism for enriching user interface design
CN104699518A (en) Multi-purpose meter reading machine adapter based on microkernel plug-in and realization method thereof
US9715372B2 (en) Executable guidance experiences based on implicitly generated guidance models
US8036857B2 (en) Design modelling
US9383972B2 (en) Methods and arrangements for processing and presentation of information
CN112130723B (en) Method and system for performing feature processing on data
CN113971019A (en) Data type creating method, device, server and medium
CN112416440A (en) Board card control method, device, equipment and medium based on measurement and control system
CN112988139A (en) Method and device for developing event processing file
US8135943B1 (en) Method, apparatus, and computer-readable medium for generating a dispatching function
CN113835914B (en) Debugging system, method, device and equipment of firmware support package
CN113703748B (en) Method, device and equipment for visualizing running logic in configuration web application program
CN114756217B (en) Plug-in based script generation system
CN110990050B (en) Model attribute value printing control method, device, medium and equipment
CN116339742A (en) Method, device and storage medium for acquiring function
CN117785178A (en) Function registration method, function registration device and storage medium
CN117435487A (en) Error checking method, device, equipment and medium for low code platform page definition

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant