Log capture method, device, equipment and storage medium

By providing a log -grabbing method, obtaining user instructions, determining the target debug object and selecting the printing level, solving the problem of low efficiency and incomplete function in the existing technology, and realizing the efficient and simplified log grabbing process. Essence

CN113515683BActive Publication Date: 2025-01-24SHENZHEN SKYWORTH RGB ELECTRONICS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110781964.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-09
Publication Date
2025-01-24
Estimated Expiration
2041-07-09

AI Technical Summary

Technical Problem

The prior art is not efficient when crawling logs, has incomplete functions and complex operations, and cannot effectively crawl kernel logs and program time logs in system logs.

Method used

A log capture method is provided. By obtaining the user's capture instructions, the target debugging object is determined, the printing level is selected based on the capture instructions, and the target debugging instructions are executed to obtain the target capture logs. This method uses a graphical interface to encapsulate debugging instructions and simplifies the crawling process.

Benefits of technology

It has improved the efficiency of log grabbing, can grasp different levels of logs, simplify the operation process. Users can easily grasp the log even if they are not familiar with the debug instructions, which greatly improves the user's work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113515683B_ABST
    Figure CN113515683B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of log processing technology, and discloses a log capture method, device, equipment and storage medium. The method includes: obtaining a user's capture instruction; determining a corresponding target debugging object according to the capture instruction; selecting a corresponding printing level in a target system selection box in the target debugging object based on the capture instruction; executing the corresponding target debugging instruction according to the printing level to obtain a target capture log. Through the above method, different debugging objects are determined according to user instructions, and after the target debugging object is determined, the corresponding printing level is selected according to the capture instruction, and the corresponding target log is captured. A graphical interface is used to encapsulate the debugging instruction, thereby improving the efficiency of the capture, and at the same time, logs of different levels can be printed, and the capture process is simplified. Even if the debugging instruction is not familiar, the log can be captured, which greatly improves the work efficiency of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of log processing technology, and in particular to a log capture method, device, equipment and storage medium. Background Art

[0002] As Android becomes the world's most popular operating system, it has more than 20 million developers. For developers, capturing the system log during debugging has become a very important part. Currently, application developers generally use the system log tool that comes with Android studio, while system developers generally use adb (Android Debug Bridge) to capture. Although both methods can capture system logs, there are two problems. The former consumes computer performance when capturing, and cannot capture kernel logs and program time logs in the system log. The latter is not efficient when capturing and has strong professional requirements for users.

[0003] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of the present invention is to provide a log capture method, device, equipment and storage medium, aiming to solve the technical problems of low capture efficiency, incomplete functions and relatively complex technology in the prior art.

[0005] To achieve the above object, the present invention provides a log capture method, which comprises the following steps:

[0006] Get the user's crawling instructions;

[0007] Determine the corresponding target debugging object according to the capture instruction;

[0008] Selecting a corresponding print level in a target system selection box in a target debugging object based on the capture instruction;

[0009] Execute the corresponding target debugging instruction according to the printing level to obtain the target capture log.

[0010] Optionally, selecting a corresponding print level in a target system selection box in a target debugging object based on the capture instruction includes:

[0011] If the target debugging object is a target debugging process, selecting a corresponding printing level in the first target selection box according to the capture instruction;

[0012] Among them, the printing levels in the first target selection box include detailed information log, debug log, general information log, error log and warning log.

[0013] Optionally, selecting a corresponding print level in a target system selection box in a target debugging object based on the capture instruction includes:

[0014] If the target debugging object is a target debugging system, selecting a corresponding printing level in a second target selection box according to the capture instruction;

[0015] Wherein, the printing levels in the second target selection box include event log and kernel log.

[0016] Optionally, determining a corresponding target debugging object according to the captured instruction includes:

[0017] Search the target listener for the terminal device whose device information is online;

[0018] According to the capture instruction, a corresponding target terminal device and a corresponding target debugging object in the target terminal device are determined in the terminal device corresponding to the online state.

[0019] Optionally, before searching the target listener for the terminal device whose device information corresponds to the online state, the method further includes:

[0020] Get the connection instruction of the terminal device;

[0021] Acquire device information corresponding to the terminal device according to the connection instruction;

[0022] Create a target listener;

[0023] The device information is stored in the target listener.

[0024] Optionally, after executing the corresponding target debugging instruction according to the print level and obtaining the target capture log, the method further includes:

[0025] Storing the target capture log as a storage log in a preset text box;

[0026] Obtain user operation instructions;

[0027] The storage log is processed according to the operation instruction.

[0028] Optionally, the processing the storage log according to the operation instruction includes:

[0029] If the operation instruction is a query instruction, searching the storage log for a corresponding target query log by using a preset matching model according to the query instruction, and displaying the target query log by using a preset display method;

[0030] If the operation instruction is a clear instruction, clearing the stored log from the buffer area and the display area corresponding to the preset text box according to the clear instruction;

[0031] If the operation instruction is a save instruction, the storage log is saved to a target storage location according to the save instruction.

[0032] In addition, to achieve the above object, the present invention also provides a log capture device, the log capture device comprising:

[0033] Acquisition module: used to obtain the user's crawling instructions;

[0034] Determining module: used to determine the corresponding target debugging object according to the capture instruction;

[0035] A selection module: used for selecting a corresponding printing level in a target system selection box in a target debugging object based on the capture instruction;

[0036] Execution module: executes the corresponding target debugging instruction according to the printing level to obtain the target capture log.

[0037] In addition, to achieve the above-mentioned purpose, the present invention also proposes a log capture device, which includes: a memory, a processor, and a log capture program stored in the memory and executable on the processor, wherein the log capture program is configured to implement the steps of the log capture method described above.

[0038] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a log capture program is stored, and when the log capture program is executed by a processor, the steps of the log capture method described above are implemented.

[0039] The present invention obtains the user's capture instruction; determines the corresponding target debugging object according to the capture instruction; selects the corresponding printing level in the target system selection box in the target debugging object based on the capture instruction; executes the corresponding target debugging instruction according to the printing level to obtain the target capture log. Through the above method, different debugging objects are determined according to the user's instructions, and after the target debugging object is determined, the corresponding printing level is selected according to the capture instruction, and the corresponding target log is captured. The debugging instruction is encapsulated using a graphical interface, which improves the capture efficiency. At the same time, logs of different levels can be printed, and the capture process is simplified. Even if the debugging instruction is not familiar, the log can be captured, which greatly improves the user's work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 It is a structural diagram of a log capture device in a hardware operating environment involved in an embodiment of the present invention;

[0041] Figure 2 This is a flow chart of the first embodiment of the log capture method of the present invention;

[0042] Figure 3 This is a flow chart of a second embodiment of the log capture method of the present invention;

[0043] Figure 4 The overall flow diagram of the log capture method of the present invention is as follows:

[0044] Figure 5 This is a structural block diagram of the first embodiment of the log capture device of the present invention.

[0045] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0046] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0047] Reference Figure 1 , Figure 1 The diagram is a structural diagram of a log capture device in a hardware operating environment according to an embodiment of the present invention.

[0048] like Figure 1 As shown, the log capture device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0049] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the log capture device, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.

[0050] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a log capture program.

[0051] exist Figure 1 In the log capture device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the log capture device of the present invention can be set in the log capture device, and the log capture device calls the log capture program stored in the memory 1005 through the processor 1001, and executes the log capture method provided by the embodiment of the present invention.

[0052] The embodiment of the present invention provides a log capture method, referring to Figure 2 , Figure 2 The figure is a flow chart of a first embodiment of a log capture method of the present invention.

[0053] In this embodiment, the log capture method includes the following steps:

[0054] Step S10: Obtain the user's crawling instruction.

[0055] It should be noted that the executor of this embodiment is a software developed based on Java that uses adb (Android DebugBridge) instructions to capture logs. This software mainly captures system logs (logs) of Android devices, fully utilizes the powerful functions of adb instructions, and visualizes all common instructions. It is a software specifically used to capture logs. This software is not restricted by the platform and can run on all computers with jre environment installed.

[0056] It should be noted that the user's capture instruction includes the user's target debugging object and the target capture log. Before the log is captured, the user's capture instruction needs to be obtained to determine the corresponding target.

[0057] Step S20: determining a corresponding target debugging object according to the captured instruction.

[0058] It should be noted that the target debugging object includes a target debugging process and a target debugging system.

[0059] It is understandable that when the target debugging object is a debugging process, the system will list the currently running processes, and then select the corresponding target debugging process from the currently running processes according to the user's needs.

[0060] In a specific implementation, to improve the efficiency of scraping, objects that can be normally debugged are filtered out before determining the target debugging object. Further, determining the corresponding target debugging object according to the scraping instruction includes: searching for a terminal device corresponding to the online status of the device information in the target listener; determining the corresponding target terminal device and the corresponding target debugging object in the target terminal device according to the scraping instruction in the terminal device corresponding to the online status.

[0061] It should be noted that the target listener refers to the listener DeviceListener registered when the software is started and is used as the target listener.

[0062] It can be understood that the device information refers to the device information corresponding to the terminal device inserted into the computer, and the device information includes but is not limited to the name, ID, and online status of the terminal device.

[0063] It should be understood that when a terminal device is inserted, the terminal device corresponding to the current online status is determined, the corresponding target debugging terminal is determined according to the user's scraping instruction among the online terminal devices, and the target debugging object is selected in the target debugging terminal.

[0064] In a specific implementation, to accurately identify whether the current terminal device is online, further, before searching for the terminal device corresponding to the online status of the device information in the target listener, it also includes: obtaining the connection instruction of the terminal device; obtaining the device information corresponding to the terminal device according to the connection instruction; creating a target listener; storing the device information in the target listener.

[0065] It should be noted that when a terminal device requests to be inserted into the computer, the connection instruction of the terminal device is obtained, the device information of the terminal device is obtained according to the connection instruction. When the user needs to scrape logs, the scraping software is started. At this time, after the software is started, a listener DeviceListener is created and registered as the target listener, and the device information of the terminal device is saved in the target listener List<DeviceInfo(device information)>, and the DeviceInfo includes but is not limited to the name, ID, and online status of the terminal device.

[0066] In a specific implementation, after obtaining the connection instruction of the terminal device, it is also necessary to identify and filter the terminal device information carried by the terminal device to determine whether there is dangerous information in the current device information. If there is dangerous information, the connection request of the device is rejected.

[0067] Step S30: Select the corresponding printing level in the target system selection box of the target debugging object based on the scraping instruction.

[0068] It should be noted that the target system selection box has different printing levels for different target debugging objects. After obtaining the user's capture instruction, the user's desired printing level is selected in the target system selection box according to the user's capture instruction.

[0069] Step S40: executing the corresponding target debugging instruction according to the printing level to obtain the target capture log.

[0070] It should be noted that the different printing levels correspond to different debugging instructions. After obtaining the user's printing level according to the user's capture instruction, the software system will automatically determine the corresponding target debugging instruction and execute it to obtain the corresponding target capture log.

[0071] In a specific implementation, in order to facilitate the analysis and search of the user's log, further, after executing the corresponding target debugging instruction according to the print level and obtaining the target capture log, it also includes: storing the target capture log as a storage log in a preset text box; obtaining the user's operation instruction; and processing the storage log according to the operation instruction.

[0072] It should be noted that the preset text box is used to store the captured logs, and the user's operation instructions include searching for keyword logs, clearing logs, and saving logs.

[0073] It is understandable that after obtaining the crawled log, the user will search for the corresponding log in the text viewing bar, that is, the preset text box, and perform certain operations on the log, so it is necessary to obtain the user's operation instructions and perform corresponding operations on the stored log in the preset text box according to the operation instructions, such as searching for keyword logs, clearing logs and saving logs.

[0074] In a specific implementation, in order to more accurately execute the user's operation instructions, further, the storage log is processed according to the operation instruction, including: if the operation instruction is a query instruction, then according to the query instruction, the corresponding target query log is searched in the storage log through a preset matching model, and the target query log is displayed in a preset display method; if the operation instruction is a clear instruction, then according to the clear instruction, the storage log is cleared from the cache area and display area corresponding to the preset text box; if the operation instruction is a save instruction, then according to the save instruction, the storage log is saved to the target storage location.

[0075] It should be noted that when the user's operation instruction is a query instruction, it is necessary to enter keywords in the filter bar of the preset text box according to the user's query instruction, find the corresponding keyword log in the storage log as the target query log through the preset matching model, and display the keyword in a preset display method. The preset display method can be that the keyword is highlighted or the keyword is marked with a black frame for display. The preset matching model is obtained by entering the text or number you want to query in the filter bar and matching and training through the KMP algorithm.

[0076] It is understandable that when the user's operation instruction is a clear instruction, the stored logs need to be completely cleared from the buffer area of ​​the preset text box according to the user's clear instruction, and the logcat -c command is executed to clear the logs of the device in the display area.

[0077] In a specific implementation, when the user's operation instruction is a save instruction, all logs in the preset text box buffer area need to be saved to a specified directory, ie, a target storage location, through a Java IO stream according to the user's save instruction.

[0078] This embodiment obtains the user's capture instruction; determines the corresponding target debugging object according to the capture instruction; selects the corresponding printing level in the target system selection box in the target debugging object based on the capture instruction; executes the corresponding target debugging instruction according to the printing level to obtain the target capture log. Through the above method, different debugging objects are determined according to the user's instructions, and after the target debugging object is determined, the corresponding printing level is selected according to the capture instruction, and the corresponding target log is captured. The debugging instruction is encapsulated using a graphical interface, which improves the capture efficiency. At the same time, logs of different levels can be printed, and the capture process is simplified. Even if the debug instruction is not familiar, the log can be captured, which greatly improves the user's work efficiency.

[0079] refer to Figure 3 , Figure 3 The figure is a flow chart of a second embodiment of a log capture method of the present invention.

[0080] Based on the first embodiment above, step S30 in the log capture method of this embodiment includes:

[0081] Step S301: If the target debugging object is a target debugging process, a corresponding printing level is selected in a first target selection box according to the capture instruction.

[0082] It should be noted that if the user's capture instruction is a debugging process, it is necessary to filter out the normal running processes in the system through ps-e before selecting the user's target debugging process, and then select the user's target debugging process from the normal running processes.

[0083] It can be understood that after selecting the target debugging process, the process identification number, i.e., PID, of the target debugging process will be recorded, and the first target selection box will have options with different print levels. Then, the corresponding print level is selected in the first target selection box as the target print level selected in the first target selection box required by the user.

[0084] Step S302: wherein the printing levels in the first target selection box include detailed information log, debug log, general information log, error log and warning log.

[0085] It should be noted that the first target selection box has the following options in the print level: detailed information log is Verbose, debug log is Debug, general information log is Info, error log is Error, and warning log is Warn.

[0086] In the specific implementation, when the user selects the print level of Verbose, the system executes log cat -v time|grep pid; when Debug is selected, the system executes logcat -v time*:D|grep pid; when Info is selected, the system executes logcat -v time*:I|grep pid; when Error is selected, the system executes logcat -v time*:E|grep pid; when Warn is selected, the system executes logcat -v time*:W|grep pid.

[0087] In a specific implementation, in order to obtain more comprehensive logs, including kernel logs and event logs, further, the corresponding printing level is selected in the target system selection box in the target debugging object based on the capture instruction, including: if the target debugging object is the target debugging system, then according to the capture instruction, the corresponding printing level is selected in the second target selection box; wherein, the printing level in the second target selection box includes event logs and kernel logs.

[0088] It should be noted that if the user's capture instruction is to debug the system, the second target selection box of "System Log" will provide two printing level options, and then select the corresponding permission level in the second target selection box according to the user's capture instruction, including kernel log, i.e. kernellog, and event log, i.e. eventlog.

[0089] It is understandable that when the user selects the print level as kernellog, execute the command cat / dev / kmsg-n>kernel.log&&logcat-v time>app.log&. When the user selects the print level as eventlog, execute the command adb logcat-v threadtime-t 4096-b events, and the user can query all life cycle information of the activity through this command.

[0090] In the specific implementation, Figure 4 As shown, when the software detects that a device is plugged into the computer, the relevant device information corresponding to the terminal device is saved in the target listener, including the DeviceName, DeviceID and DeviceStatus of the terminal device. When the user's target debugging object is selected to debug a process, the system will list the processes that are currently running normally, and then the user selects the target debugging process from the processes that are running normally. After selecting the process, different print levels (Verbose, Debug, Info, Error and Warn) can be selected in the first target selection box. When the user's target debugging object is to debug the system, different print levels eventlog or kernellog are selected in the second target selection box. All logs will be output to the cache area of ​​the preset text box. At the same time, the preset text box supports keyword positioning, saving and clearing.

[0091] In this embodiment, if the target debugging object is a target debugging process, the corresponding printing level is selected in the first target selection box according to the capture instruction; wherein the printing level in the first target selection box includes detailed information log, debug log, general information log, error log and warning log. The corresponding target log is selectively captured according to the capture instruction, and the adb instruction is encapsulated at the same time, so that the capture process is simpler and more comprehensive, and the work efficiency is improved.

[0092] In addition, refer to Figure 5 The embodiment of the present invention further provides a log capture device, the log capture device comprising:

[0093] The acquisition module 10 is used to acquire the user's crawling instruction.

[0094] The determination module 20 is used to determine the corresponding target debugging object according to the capture instruction.

[0095] The selection module 30 is used to select a corresponding printing level in a target system selection box in a target debugging object based on the capture instruction.

[0096] The execution module 40 executes the corresponding target debugging instruction according to the printing level to obtain the target capture log.

[0097] This embodiment obtains the user's capture instruction; determines the corresponding target debugging object according to the capture instruction; selects the corresponding printing level in the target system selection box in the target debugging object based on the capture instruction; executes the corresponding target debugging instruction according to the printing level to obtain the target capture log. Through the above method, different debugging objects are determined according to the user's instructions, and after the target debugging object is determined, the corresponding printing level is selected according to the capture instruction, and the corresponding target log is captured. The debugging instruction is encapsulated using a graphical interface, which improves the capture efficiency. At the same time, logs of different levels can be printed, and the capture process is simplified. Even if the debug instruction is not familiar, the log can be captured, which greatly improves the user's work efficiency.

[0098] In one embodiment, the selection module 30 is further configured to select a corresponding printing level in the first target selection box according to the capture instruction if the target debugging object is a target debugging process;

[0099] Among them, the printing levels in the first target selection box include detailed information log, debug log, general information log, error log and warning log.

[0100] In one embodiment, the selection module 30 is further configured to select a corresponding printing level in a second target selection box according to the capture instruction if the target debugging object is a target debugging system;

[0101] Wherein, the printing levels in the second target selection box include event log and kernel log.

[0102] In one embodiment, the determination module 20 is further used to search the target monitor for a terminal device whose device information corresponds to an online state;

[0103] According to the capture instruction, a corresponding target terminal device and a corresponding target debugging object in the target terminal device are determined in the terminal device corresponding to the online state.

[0104] In one embodiment, the determination module 20 is further used to obtain a connection instruction of the terminal device;

[0105] Acquire device information corresponding to the terminal device according to the connection instruction;

[0106] Create a target listener;

[0107] The device information is stored in the target listener.

[0108] In one embodiment, the execution module 40 is further used to store the target capture log as a storage log in a preset text box;

[0109] Obtain user operation instructions;

[0110] The storage log is processed according to the operation instruction.

[0111] In one embodiment, the execution module 40 is further configured to, if the operation instruction is a query instruction, search for a corresponding target query log in the storage log according to the query instruction through a preset matching model, and display the target query log in a preset display mode;

[0112] If the operation instruction is a clear instruction, clearing the stored log from the buffer area and the display area corresponding to the preset text box according to the clear instruction;

[0113] If the operation instruction is a save instruction, the storage log is saved to a target storage location according to the save instruction.

[0114] Since the present device adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought by the technical solutions of the above embodiments, which will not be described one by one here.

[0115] In addition, an embodiment of the present invention further provides a storage medium, on which a log capture program is stored. When the log capture program is executed by a processor, the steps of the log capture method described above are implemented.

[0116] Since the storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought by the technical solutions of the above embodiments, which will not be described one by one here.

[0117] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.

[0118] In addition, for technical details not fully described in this embodiment, reference can be made to the log capture method provided in any embodiment of the present invention, and will not be repeated here.

[0119] In addition, it should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0120] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0121] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0122] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A log capture method, characterized in that: The log capture method comprises: Obtaining a user's capture instruction, wherein the capture instruction includes a target debugging object and a target capture log; Determine a corresponding target debugging object according to the captured instruction, wherein the target debugging object includes a target debugging process and a target debugging system; Selecting a corresponding print level in a target system selection box in a target debugging object based on the capture instruction; Execute the corresponding target debugging instruction according to the printing level to obtain the target capture log; The step of selecting a corresponding printing level in a target system selection box in a target debugging object based on the capture instruction includes: If the target debugging object is a target debugging process, selecting a corresponding printing level in the first target selection box according to the capture instruction; Wherein, the printing levels in the first target selection box include detailed information log, debug log, general information log, error log and warning log; Wherein, determining the corresponding target debugging object according to the captured instruction includes: Search the target listener for the terminal device whose device information is online; Determine a corresponding target terminal device and a corresponding target debugging object in the target terminal device in the terminal device corresponding to the online state according to the capture instruction; Before searching the target listener for the terminal device whose device information corresponds to the online state, the method further includes: Get the connection instruction of the terminal device; Acquire device information corresponding to the terminal device according to the connection instruction; Create a target listener; The device information is stored in the target listener.

2. The log capture method according to claim 1, characterized in that: The selecting a corresponding print level in a target system selection box in a target debugging object based on the capture instruction includes: If the target debugging object is a target debugging system, selecting a corresponding printing level in a second target selection box according to the capture instruction; Wherein, the printing levels in the second target selection box include event log and kernel log.

3. The log capture method as claimed in claim 1 or 2, characterized in that: After executing the corresponding target debugging instruction according to the print level and obtaining the target capture log, the method further includes: Storing the target capture log as a storage log in a preset text box; Obtain user operation instructions; The storage log is processed according to the operation instruction.

4. The log capture method according to claim 3, characterized in that: The processing of the storage log according to the operation instruction includes: If the operation instruction is a query instruction, searching the storage log for a corresponding target query log by using a preset matching model according to the query instruction, and displaying the target query log by using a preset display method; If the operation instruction is a clear instruction, clearing the stored log from the buffer area and the display area corresponding to the preset text box according to the clear instruction; If the operation instruction is a save instruction, the storage log is saved to a target storage location according to the save instruction.

5. A log capture device, characterized in that: The log capture device comprises: Acquisition module: used to acquire the user's capture instruction, the capture instruction includes the target debugging object and the target capture log; A determination module: used to determine a corresponding target debugging object according to the capture instruction, wherein the target debugging object includes a target debugging process and a target debugging system; A selection module: used for selecting a corresponding printing level in a target system selection box in a target debugging object based on the capture instruction; Execution module: executes the corresponding target debugging instruction according to the printing level to obtain the target capture log; The selection module is further configured to select a corresponding printing level in the first target selection box according to the capture instruction if the target debugging object is a target debugging process; Wherein, the printing levels in the first target selection box include detailed information log, debug log, general information log, error log and warning log; The determination module is further used to search the target listener for a terminal device whose device information corresponds to an online state; determine the corresponding target terminal device and the corresponding target debugging object in the target terminal device in the terminal device corresponding to the online state according to the capture instruction; The determination module is further used to obtain a connection instruction of a terminal device; obtain device information corresponding to the terminal device according to the connection instruction; create a target listener; and store the device information in the target listener.

6. A log capture device, characterized in that: The device comprises: a memory, a processor, and a log capture program stored in the memory and executable on the processor, wherein the log capture program is configured to implement the log capture method according to any one of claims 1 to 4.

7. A storage medium, characterized in that: The storage medium stores a log capture program, and when the log capture program is executed by the processor, the log capture method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Log capturing and debugging method and system, intelligent equipment and storage medium

    CN112783724A