Log output target control method, electronic equipment and storage medium

By maintaining the log output target list and dynamically changing the log output target, the problem of difficulty in switching log output targets in the intelligent automobile distributed domain control system is solved, and the log output target control without restart is achieved, which improves system performance and efficiency.

CN119511788APending Publication Date: 2025-02-25吉咖智能机器人有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411650032.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

It is difficult for the existing technology to dynamically switch or recombine log output targets in the intelligent automobile distributed domain control system, affecting the system's monitoring, debugging and troubleshooting efficiency.

Method used

By maintaining the log output target list, receiving change requests, parsing requests, deleting or adding targets, and controlling log output based on the changed list, the function of dynamic change log output targets is realized.

Benefits of technology

No system restart is required, the log output target is dynamically controlled, the system performance and efficiency are improved, and the orderliness and reliability of log output in multi-threaded scenarios are supported.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119511788A_ABST
    Figure CN119511788A_ABST
Patent Text Reader

Abstract

The invention discloses a control method of a log output target, electronic equipment and a storage medium. The control method of the log output target comprises the following steps: receiving a change request of the log output target; changing a log output target list according to the change request to obtain a changed log output target list; and controlling log output according to the changed log output target list. The purpose of dynamically changing the log output target in the system operation process is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of log output target control, and in particular to a log output target control method, electronic device and storage medium. Background Art

[0002] With the continuous development of distributed domain control systems for smart cars, the functions of the software they carry are becoming more diverse, and software updates and iterations are becoming more frequent, which inevitably leads to some problems. As one of the key technical means of analyzing problems, the log system plays an important role in monitoring, debugging, troubleshooting, and compliance requirements. The log system helps developers and maintenance personnel understand the system status and locate problems in a timely manner by recording events, errors, warnings, and other information during system operation.

[0003] In an actual production environment, it may be necessary to dynamically switch or reorganize log output targets in order to better observe the operating status of the system. However, the existing technology lacks an effective method to achieve this.

[0004] In view of this, this application is hereby filed. Summary of the invention

[0005] A brief summary of one or more aspects is given below to provide a basic understanding of these aspects. This summary is not an exhaustive overview of all conceived aspects, and is neither intended to identify the key or critical elements of all aspects nor to define the scope of any or all aspects. Its only purpose is to give some concepts of one or more aspects in a simplified form as a prelude to a more detailed description that will be given later.

[0006] The present application provides a control method for a log output target, an electronic device and a storage medium, which achieve the purpose of dynamically changing the log output target during system operation.

[0007] In a first aspect, the present application provides a method for controlling a log output target, comprising the following steps:

[0008] Receive change requests for log output targets;

[0009] Modify the log output target list according to the modification request to obtain the modified log output target list;

[0010] Control log output according to the changed log output target list.

[0011] Furthermore, the changing the log output target list according to the change request to obtain the changed log output target list includes: when the lock state of the log output target list is unlocked, changing the log output target list according to the change request to obtain the changed log output target list.

[0012] Furthermore, after receiving the request to change the log output target, the method further includes:

[0013] When the lock state of the log output target list is locked, the system enters a dormant state and waits to be awakened when the lock state of the log output target list changes to an unlocked state.

[0014] Further, the log output target list is modified according to the modification request to obtain the modified log output target list, including:

[0015] Parsing the change request to determine the target to be changed and the indicated target;

[0016] The target to be changed is deleted from the log output target list, and the indicated target is added to the log output target list.

[0017] Furthermore, controlling the log output according to the changed log output target list includes:

[0018] In response to receiving a log output request, when the lock state of the log output target list is unlocked, control the log to be output to each target recorded in the modified log output target list.

[0019] Further, the log output target list is modified according to the modification request to obtain the modified log output target list, including:

[0020] Parsing the change request to determine the indicated target;

[0021] The indicated target is added to the log output target list to obtain a changed log output target list.

[0022] Furthermore, controlling the log output according to the changed log output target list includes:

[0023] In response to receiving a log output request, when the lock state of the log output target list is unlocked, determining one or more targets matching the log output request from the modified log output target list;

[0024] Control log output to the one or more targets.

[0025] Furthermore, before parsing the change request, changing the log output target list according to the change request further includes:

[0026] Set the lock state of the log output target list to be locked;

[0027] And, after the log output target list is changed according to the change request, the method further includes:

[0028] The lock state of the log output target list is set to unlocked.

[0029] In a second aspect, the present application further provides an electronic device, the electronic device comprising:

[0030] one or more processors;

[0031] A storage device for storing one or more programs;

[0032] When the one or more programs are executed by the one or more processors, the one or more processors implement the control method of the log output target as described above.

[0033] In a third aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the control method for the log output target as described above.

[0034] The control method of log output target disclosed in the present application realizes the purpose of dynamically controlling log output target during system operation by maintaining a log output target list and then controlling log output according to the log output target list, without restarting the system, which is beneficial to improving system performance and efficiency. Specifically, a log output target change request is received; the log output target list is changed according to the change request to obtain a changed log output target list; and log output is controlled according to the changed log output target list. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for describing the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0036] Figure 1 A flow chart of a control method for a log output target provided in an embodiment of the present application Figure 1 ;

[0037] Figure 2A flow chart of a control method for a log output target provided in an embodiment of the present application Figure 2 ;

[0038] Figure 3 A flow chart of a control method for a log output target provided in an embodiment of the present application Figure 3 ;

[0039] Figure 4 A schematic diagram of a control system for a log output target provided in an embodiment of the present application;

[0040] Figure 5 A control method flow diagram of a log output target provided in an embodiment of the present application Figure 4 ;

[0041] Figure 6 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0042] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.

[0043] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0044] Figure 1 This is a flow chart of a control method for a log output target proposed in the present application. The control method for the log output target can be executed by a control device for the log output target. The control device for the log output target can be implemented in the form of software and / or hardware and integrated into an electronic device, for example, can be specifically integrated into a vehicle controller.

[0045] like Figure 1 As shown, the control method of the log output target includes the following steps:

[0046] S110: Receive a request to change a log output target.

[0047] The log output target refers to the log output location, such as the console, remote server, or local file. For example, during the system debugging phase, in order to clearly and intuitively observe the real-time operating status of the system, you can choose to output the log to the console so that technicians can promptly discover and solve potential problems. During the normal operation of the system, in order to save storage space and improve system performance, you can choose to output the log to a local file or remote server. Therefore, it is of great significance to be able to flexibly adjust the log output target.

[0048] The change request of the log output target can be triggered by the host computer. Specifically, the technician can trigger the change request of the log output target according to the system operation status. For example, in the system debugging stage, in order to clearly and intuitively observe the real-time operation status of the system, the log can be output to the console so that the technician can find and solve potential problems in time. In the normal operation stage of the system, in order to save storage space and improve system performance, the log can be output to a local file or a remote server.

[0049] Alternatively, the change request of the log output target may be automatically triggered by automation means, for example, when a specific flag is detected, a change request of a matching log output target is triggered.

[0050] The change request of the log output target may specifically include an indicated target, that is, the log is expected to be output to a certain location, and the location is the indicated target. For example, the change request of the log output target is specifically "please output the log to a remote server", where "remote server" is the indicated target. This means that after this change, the log output target includes the remote server, that is, the log must be output to at least the remote server.

[0051] The change request of the log output target may also include a target to be changed, i.e., a target to be changed. For example, the change request of the log output target is specifically "please change the log output from the console to the remote server", wherein "console" is the target to be changed and "remote server" is the indicated target. This means that before this change, the log is output to the console, and after this change, the log is no longer output to the console, but to the remote server.

[0052] Furthermore, the request to change the log output target may include multiple indicated targets and multiple targets to be changed, so as to achieve flexible output of logs and multi-target output.

[0053] S120: modify the log output target list according to the modification request to obtain a modified log output target list.

[0054] In some embodiments, the log output target list is changed according to the change request to obtain the changed log output target list, including: parsing the change request to determine the target to be changed and the indicated target; deleting the target to be changed from the log output target list, and adding the indicated target to the log output target list. For example, the change request is "Please change the log output from the console to the remote server". By parsing the change request, it is identified that the "console" is the target to be changed and the "remote server" is the indicated target. Then, the log write path corresponding to the "console" recorded in the log output target list is deleted, and the log write path corresponding to the "remote server" is added to the log output target list to obtain the changed log output target list.

[0055] Exemplarily, adding the indicated target to the output target list and deleting the target to be changed from the output target list can be achieved through a custom function.

[0056] In other embodiments, the log output target list is changed according to the change request to obtain the changed log output target list, including: parsing the change request to determine the indicated target; adding the indicated target to the log output target list to obtain the changed log output target list. This embodiment corresponds to the scenario of adding a log output target, for example, the change request of the log output target is specifically "please output the log to a remote server", wherein "remote server" is the indicated target. This means that after this change, the log output target includes the remote server.

[0057] S130. Control log output according to the modified log output target list.

[0058] In some implementations, controlling log output according to the modified log output target list includes:

[0059] In response to receiving a log output request, the log is controlled to be output to each target recorded in the changed log output target list. Alternatively, one or more targets matching the log output request are determined from the changed log output target list; and the log is controlled to be output to the one or more targets. Thus, the purpose of dynamically changing the log output target is achieved.

[0060] The control method of the log output target disclosed in the embodiment of the present application maintains a log output target list and then controls the log output according to the log output target list, thereby achieving the purpose of dynamically controlling the log output target during system operation without the need for system restart, which is beneficial to improving system performance and efficiency.

[0061] On the basis of the above embodiment, this embodiment provides another method for controlling log output targets, specifically, optimizing the design of step S120 in the above embodiment, "changing the log output target list according to the change request to obtain the changed log output target list", with the purpose of ensuring the orderliness of changing the log output target list in a multi-threaded scenario, and avoiding multiple threads changing the log output target list at the same time, thereby causing a change conflict. In other words, the optimization design of this embodiment can improve the stability and reliability of the change of the log output target list, thereby improving the controllability and flexibility of the log output.

[0062] like Figure 2 As shown, the control method of the log output target includes the following steps:

[0063] S210: Receive a request to change a log output target.

[0064] S220: When the lock state of the log output target list is unlocked, modify the log output target list according to the modification request to obtain a modified log output target list.

[0065] Wherein, under the multithreading scene, in order to avoid having multiple threads to change the log output target list at the same time, thereby causing a conflict, before a thread changes the log output target list, the locking state of the log output target list is determined, if the locking state of the log output target list is in the case of being unlocked, the log output target list is changed according to the change request, and the changed log output target list is obtained. If the locking state of the log output target list is in the case of being locked (indicating that other threads are changing the log output target list at the current moment), the current thread then enters a dormant state, and waits to be awakened when the locking state of the log output target list jumps to an unlocked state.

[0066] Specifically, when a thread obtains the control authority of the log output target list (i.e., determines that the lock state of the log output target list is unlocked), when changing the log output target list, the lock state of the log output target list is set to "locked" to inform other threads that want to change the log output target list, so that other threads that want to change the log output target list enter a dormant state, so as to avoid multiple threads changing the log output target list at the same time, thereby causing a conflict. When the lock state of the log output target list jumps to "unlocked", the dormant thread is awakened so that it continues to operate on the log output target list. In this way, the orderliness of the changes to the log output target list is guaranteed in the multi-threaded scenario, and multiple threads are prevented from changing the log output target list at the same time, thereby causing a change conflict.

[0067] Wherein, the locking state of the log output target list can be realized by a condition variable or a mutex lock. Wherein, the mutex lock is used to ensure that the thread will not be interrupted by other threads when modifying shared data (i.e., the log output target list). The condition variable is used to wake up the thread when a certain condition is met. For example, a thread wants to change the log output target list. First, it obtains the mutex lock to ensure exclusive access to the log output target list, and sets the value of the condition variable "is_switching" to true to notify other threads that the log output target list is being occupied. When the log output target list is changed, the mutex lock is released, and the value of the condition variable "is_switching" is set to false to wake up other threads that are dormant because the value of the condition variable is true.

[0068] In summary, the log output target list is changed according to the change request to obtain the changed log output target list, including: when the value of the condition variable is a first preset value (indicating that the lock state of the log output target list is unlocked), acquiring a mutex lock, and setting the value of the condition variable to a second preset value (i.e., setting the lock state of the log output target list to be locked), and changing the log output target list according to the change request to obtain the changed log output target list. After the log output target list is changed according to the change request, the mutex lock is released, and the value of the condition variable is set to the first preset value, i.e., setting the lock state of the log output target list to be unlocked, so that other threads can continue to operate on the log output target list.

[0069] In some embodiments, the log output target list is changed according to the change request to obtain the changed log output target list, including: setting the lock state of the log output target list to locked, parsing the change request, determining the target to be changed and the indicated target; deleting the target to be changed from the log output target list, and adding the indicated target to the log output target list; setting the lock state of the log output target list to unlocked.

[0070] Alternatively, the log output target list is changed according to the change request to obtain the changed log output target list, including: setting the lock state of the log output target list to locked, parsing the change request to determine the indicated target; adding the indicated target to the log output target list to obtain the changed log output target list; setting the lock state of the log output target list to unlocked.

[0071] S230: When the lock state of the log output target list is locked, enter a dormant state, and wait to be awakened when the lock state of the log output target list changes to an unlocked state.

[0072] S240. Control log output according to the changed log output target list.

[0073] The control method of log output target provided in this embodiment optimizes the design of step S120 "changing the log output target list according to the change request to obtain the changed log output target list" in the above embodiment, specifically, when the lock state of the log output target list is unlocked, the log output target list is changed according to the change request to obtain the changed log output target list, and before changing the log output target list according to the change request, the lock state of the log output target list is set to be locked; after changing the log output target list according to the change request, the lock state of the log output target list is set to be unlocked. When the lock state of the log output target list is locked, enter the dormant state and wait to be awakened when the lock state of the log output target list jumps to the unlocked state. In a multi-threaded scenario, the orderliness of the change of the log output target list is guaranteed, and multiple threads are prevented from changing the log output target list at the same time, thereby causing a change conflict. The optimized design of this embodiment can improve the change stability and reliability of the log output target list, thereby improving the controllability and flexibility of log output.

[0074] On the basis of the above embodiment, this embodiment provides another method for controlling log output targets, specifically, optimizing the design of step S130 "controlling log output according to the modified log output target list" in the above embodiment, with the purpose of ensuring the orderliness of log output in a multi-threaded scenario, avoiding conflicts caused by multiple threads outputting logs at the same time, and causing inconsistent and confusing log information. In other words, the optimization design of this embodiment can improve the stability and reliability of log output, thereby improving the controllability and flexibility of log output.

[0075] like Figure 3 As shown, the control method of the log output target includes the following steps:

[0076] S310: Receive a request to change a log output target.

[0077] S320: Change the log output target list according to the change request to obtain a changed log output target list.

[0078] S330. In response to receiving a log output request, when the lock state of the log output target list is unlocked, control the log to be output to each target recorded in the changed log output target list; or, determine one or more targets that match the log output request from the changed log output target list.

[0079] That is, when a thread outputs logs, it is also necessary to determine the lock status of the log output target list at the current moment, that is, to determine whether there are other threads outputting logs at the current moment. If there are no other threads outputting logs, the current thread can output logs. If there are other threads outputting logs, the current thread cannot output logs. The current thread goes into sleep mode and waits to be awakened before executing the log output operation, thereby ensuring the orderliness, uniqueness and reliability of log output in multi-threaded scenarios.

[0080] Specifically, if there are no other threads that are outputting logs, the current thread can output logs, the current thread acquires a mutex lock, and sets the value of the condition variable to the second preset value (i.e., setting the lock state of the log output target list to be locked), the current thread starts to output logs, and after the output is completed, the mutex lock is released, and the value of the condition variable is set to the first preset value (i.e., setting the lock state of the log output target list to be unlocked), so as to wake up other threads that are dormant and enable other threads to continue to output logs. In a multi-threaded scenario, the orderliness of log output is guaranteed, and multiple threads are prevented from outputting logs at the same time, thereby causing conflicts and causing inconsistent and chaotic log information. In other words, the stability and reliability of log output can be improved through the optimized design of this embodiment, thereby improving the controllability and flexibility of log output.

[0081] On the basis of the above-mentioned embodiments, a control system for log output targets is provided, aiming to solve the problem that log output targets cannot be switched dynamically. The control system for log output targets provided by the present application allows the user to dynamically switch or recombine the output targets of the log according to different environmental conditions (such as system load, operating environment, user input, etc.) when the system is running, thereby improving the flexibility of the log system. The core of the present application is to create and manage different log output targets (sinks), which include different types of targets such as consoles, files, and remote servers. Specifically, according to the request of the dynamic control module (host computer), the switching of log output targets is controlled, and flexible combinations of multiple output targets such as consoles, files, and remote servers are supported, while ensuring that the logging operations being performed are not affected during the switching process. In addition, the present application also supports multi-threaded environments, which can avoid the loss of log data due to competition between threads. For example Figure 4As shown, the control system of the log output target provided by the present application includes the following four modules: a log management module 410 , a dynamic control module 420 , a configuration module 430 and a multi-threading module 440 .

[0082] The log management module 410 is mainly responsible for the following two points: when the system starts, it receives the initialization configuration of the APExe application process and specifies the default log output target, refresh frequency and other parameters. When the system is running, it receives the dynamic change request of the dynamic control module 420 (host computer), creates a new log output target in real time according to the dynamic change request, and adds it to the output target list, or removes the existing log output target from the output target list. At the same time, a safety mechanism is introduced to ensure that the log recording operation being executed will not be affected during the switching process, and the addition, deletion or recombination of the log output target is realized to achieve the purpose of dynamic control. Specifically, the log management module 410 can be further subdivided into the APExe application process and the manager. When the system starts, the APExe application process is responsible for loading the corresponding log configuration file, initializing the log output configuration, and receiving the change request of the log output target sent by the dynamic control module 420 when the system is running, parsing the request content, calling the specific output target change interface, and ensuring that the system's log output can be flexibly switched according to demand. The manager is implemented through a singleton, creates and manages different log output targets, performs operations such as adding, removing, and recombination of log output targets, and also realizes the initialization configuration of the log. Furthermore, the log output target list includes multiple log output targets.

[0083] The dynamic control module 420 is mainly connected to the system on chip SOC (System Of Chip) through the host computer. The client Client located in the host computer first initiates a connection request to connect to the server Server on the SOC. After the connection is completed, when the system is running, it can send a change request for the log output target according to the debugging requirements and the specific conditions of the system operation. For example, during the debugging stage, in order to be able to clearly and intuitively observe the real-time operating status of the system, it is necessary to output the log to the console so that technicians can discover and solve potential problems in a timely manner. When the system is running normally, in order to save storage space and improve system performance, the log is output to a file or a remote server.

[0084] The configuration module 430 can generate a corresponding log configuration according to the log configuration file log.conf. The log management module 410 creates a corresponding log output target according to the configuration module 430. When the system starts, the configuration file is loaded, and the initial configuration of the log is generated according to the content in the configuration file, and the default output target of the log is clearly specified, or the default output target is not set.

[0085] The multithreading module 440 implements a thread-safe dynamic switching mechanism for log output targets through conditional variables and mutexes. Log output operations and output target change operations are synchronized by mutexes and conditional variables to prevent multiple threads from accessing or modifying the output target at the same time. When a thread outputs a log, it first acquires a mutex. If other threads are modifying the output target, the current thread goes dormant and enters a waiting state. Waiting for wakeup can be achieved by conditional variables. This mechanism can ensure the correctness and data consistency of log output target switching in multithreaded scenarios, avoid multiple threads from outputting logs or modifying output targets at the same time, thereby causing conflicts, resulting in inconsistent and confusing log information, and can improve system stability and log management flexibility.

[0086] In some embodiments, reference is made to Figure 5 The flowchart of a control method for a log output target shown in FIG. 1 specifically includes the following steps:

[0087] S510: Request to change the log output target.

[0088] S520, check whether the log is being output or the log output target is being changed, if so, enter sleep mode and wait for wake-up, otherwise, acquire a mutex lock.

[0089] S530, entering sleep mode and waiting to be awakened.

[0090] S540: Acquire the mutex lock and set the condition variable to true.

[0091] S550: Change the log output destination.

[0092] S560. Release the mutex lock and set the condition variable to false.

[0093] In summary, the whole process is: system initialization, default loading of predefined log output target, and receiving log output target change request. When each thread performs log output operation, it first obtains the mutex lock to ensure exclusive access to the log output target. Only after obtaining the mutex lock can the thread perform log output operation. If the thread finds that the current log output target is being changed by other threads (it can be determined by detecting the condition variable is_switching whether the current log output target is being changed by other threads), the current thread enters the waiting state through the condition variable is_switching until it is awakened. Similarly, when a thread needs to change the log output target, it first obtains the mutex lock and sets the condition variable is_switching to true to notify other threads that there is currently a thread changing the output target. When the change is completed, the condition variable is_switching is set to false, and all waiting threads are awakened through this condition variable. After being awakened, the waiting thread rechecks the log output target and outputs the log to the new output target.

[0094] The present application scheme can realize dynamic control of log output targets, and it has the characteristics of flexibility, scalability, isolation, controllability, and real-time performance. Flexibility is reflected in the real-time change of output targets according to user needs. Scalability refers to the ability to flexibly add new output targets. Isolation means that each output target is independent and can be operated separately without affecting each other. Real-time performance means that the output target can be changed during system operation without restarting the application. The purpose and significance of realizing multiple output targets of logs include: meeting different needs at different stages, such as wanting to view logs on the console during the development stage, and wanting to write logs to files or send them to remote servers during the production stage; reliability, when an output target has a problem, the log can be saved through other output targets; easy to analyze, different output targets are suitable for different analysis methods, such as logs output to files are more suitable for offline analysis, and logs output to remote servers are convenient for real-time analysis and monitoring.

[0095] Figure 6 Schematic diagram of the structure of an electronic device in the embodiment of the present disclosure. Figure 6 , which shows a structural schematic diagram of an electronic device 500 suitable for implementing the embodiments of the present disclosure. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0096] like Figure 6As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage device 508 into a random access memory (RAM) to implement the method of the embodiment described in the present disclosure. In RAM503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, ROM 502, and RAM503 are connected to each other via a bus 504. An I / O interface 505 is also connected to the bus 504. An input device 506, an output device 507, a storage device 508, and a communication device 509 are all connected to the I / O interface 505.

[0097] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart, thereby realizing the control method of the log output target as described above. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0098] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0099] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device executes the method steps in the present application.

[0100] Optionally, when the above one or more programs are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.

[0101] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0102] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.

[0103] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and its core ideas of this application. The above is only the preferred implementation method of this application. It should be pointed out that due to the limitations of textual expression and the objective existence of infinite specific structures, ordinary technicians in this technical field can make several improvements, modifications or changes without departing from the principles of this application, and can also combine the above technical features in an appropriate manner; these improvements, modifications, changes or combinations, or the direct application of the concept and technical solution of the invention to other occasions without improvement, should be regarded as the scope of protection of this application.

Claims

1. A method for controlling a log output target, characterized in that: include: Receive change requests for log output targets; Modify the log output target list according to the modification request to obtain the modified log output target list; Control log output according to the changed log output target list.

2. The method for controlling a log output target according to claim 1, characterized in that: The step of changing the log output target list according to the change request to obtain the changed log output target list includes: When the lock state of the log output target list is unlocked, the log output target list is modified according to the modification request to obtain a modified log output target list.

3. The method for controlling a log output target according to claim 1, characterized in that: After receiving the request to change the log output target, the method further includes: When the lock state of the log output target list is locked, the system enters a dormant state and waits to be awakened when the lock state of the log output target list changes to an unlocked state.

4. The method for controlling a log output target according to claim 1, characterized in that: The step of changing the log output target list according to the change request to obtain the changed log output target list includes: Parsing the change request to determine the target to be changed and the indicated target; The target to be changed is deleted from the log output target list, and the indicated target is added to the log output target list.

5. The method for controlling a log output target according to claim 4, characterized in that: The controlling log output according to the changed log output target list includes: In response to receiving a log output request, when the lock state of the log output target list is unlocked, control the log to be output to each target recorded in the modified log output target list.

6. The method for controlling a log output target according to claim 1, characterized in that: The step of changing the log output target list according to the change request to obtain the changed log output target list includes: Parsing the change request to determine the indicated target; The indicated target is added to the log output target list to obtain a changed log output target list.

7. The method for controlling a log output target according to claim 1, characterized in that: The controlling log output according to the changed log output target list includes: In response to receiving a log output request, when the lock state of the log output target list is unlocked, determining one or more targets matching the log output request from the modified log output target list; Control log output to the one or more targets.

8. The method for controlling a log output target according to claim 4 or 6, characterized in that: Before parsing the change request, the log output target list is changed according to the change request, further comprising: Set the lock state of the log output target list to be locked; And, after the log output target list is changed according to the change request, the method further includes: The lock state of the log output target list is set to unlocked.

9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the control method for log output targets according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the control method for a log output target according to any one of claims 1 to 7 is implemented.