CN113778952A - Log output method, device, setting and storage medium - Google Patents

Log output method, device, setting and storage medium Download PDF

Info

Publication number
CN113778952A
CN113778952A CN202111093469.0A CN202111093469A CN113778952A CN 113778952 A CN113778952 A CN 113778952A CN 202111093469 A CN202111093469 A CN 202111093469A CN 113778952 A CN113778952 A CN 113778952A
Authority
CN
China
Prior art keywords
log
type
output
data
rule
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.)
Pending
Application number
CN202111093469.0A
Other languages
Chinese (zh)
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.)
Spreadtrum Communications Shanghai Co Ltd
Original Assignee
Spreadtrum Communications Shanghai 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 Spreadtrum Communications Shanghai Co Ltd filed Critical Spreadtrum Communications Shanghai Co Ltd
Priority to CN202111093469.0A priority Critical patent/CN113778952A/en
Publication of CN113778952A publication Critical patent/CN113778952A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/144Query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Library & Information Science (AREA)
  • Human Computer Interaction (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The log output method, the log output device, the log output equipment and the log output storage medium provided by the embodiment of the application comprise the steps of running an application program; and outputting first log data in the process of running the application program, wherein the first log data is data of which the output attribute of the corresponding log type is in an open state. According to the method, only the log data concerned by the user can be output, the output of the log data which is not concerned by operation and maintenance personnel is closed, and the query and retrieval efficiency is improved, so that the user experience is improved.

Description

Log output method, device, setting and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for outputting a log.
Background
The log file is a file which records the execution condition of the program and is generated by writing a log function in the program. The write log function is written in a programming language and is called as well as the programming function. The function is called at a proper place, so that the running condition of the whole program can be comprehensively known, and the program can be conveniently tracked and debugged. The log file is a main tool for checking program problems and is a tool for debugging the program. Currently, in order to analyze program problems in electronic devices, logs need to be output, and by looking at the logs, problems occurring can be located so as to repair defects in programs. Of course, the operation and maintenance personnel can know the operation state of the electronic device by looking up the log, such as the time consumption of the electronic device, the use condition of the processor, and the like. In the prior art, when an electronic device performs log output, logs of all currently running programs need to be output. A large amount of log output needs to use a large log buffer area, and occupies a large amount of system resources, operation and maintenance personnel need to query required log data in a large amount of output logs, the query efficiency is low, and the user experience is poor.
Disclosure of Invention
In view of this, the present application provides a log output method, apparatus, device and storage medium, so as to solve the problem of low efficiency of log data query and retrieval in the prior art.
In a first aspect, an embodiment of the present application provides a log output method, including:
running an application program;
and outputting first log data in the process of running the application program, wherein the first log data is data of which the output attribute of the corresponding log type is in an open state.
Preferably, before the running the application program, the method further comprises:
receiving a first log retrieval instruction; the first log retrieval instruction is used for indicating to output log data of a first log type;
switching an output attribute of a first log type to an on state according to the first log retrieval instruction;
the outputting the first log data during the running of the application program comprises:
in the course of running the application program, log data of a first log type is output as first log data.
Preferably, before the receiving the first log retrieval instruction, the method further comprises:
setting output attributes of the first log type and the other log types to be in a closed state; wherein the other log types are log types other than the first log type and include at least a second log type.
Preferably, the first log type includes any one of a communication type, an application type, a stability type, and a power consumption type.
Preferably, before the receiving the first log retrieval instruction, the method further comprises:
detecting a code for generating a log according to a preset log rule;
identifying codes which do not accord with a preset log rule in the codes, and generating a log detection report, wherein the codes which do not accord with the preset log rule are recorded in the log detection report;
and sending the log detection report to a user.
Preferably, the preset logging rule includes that a code for generating the log does not include sensitive information of a user, and/or a code for generating the log includes a related code for characterizing a log type of a type required by the log data.
Preferably, after the outputting the first log data during the running of the application program, the method further includes:
an output attribute of the first log type is switched to an off state.
In a second aspect, an embodiment of the present application provides a log output apparatus, including:
the processing module is used for running the application program;
and the output module is used for outputting first log data when the application program is operated, wherein the first log data is data of which the corresponding log type has the output attribute in an open state.
Preferably, the method further comprises the following steps:
the receiving module is used for receiving a first log retrieval instruction; the first log retrieval instruction is used for indicating to output log data of a first log type;
and the processing module is also used for switching the output attribute type of the first log type into an open state according to the first log retrieval instruction.
Preferably, the processing module is further configured to set output attributes of the first log type and the other log types to an off state; wherein the other log types are log types other than the first log type and include at least a second log type.
Preferably, the method further comprises the following steps: a sending module; wherein the content of the first and second substances,
the processing module is also used for detecting a code for generating the log according to a preset log rule;
the processing module is further used for identifying codes which do not accord with the preset log rule in the codes and generating a log detection report, wherein the codes which do not accord with the preset log rule are recorded in the log detection report;
and the sending module is used for sending the log detection report to a user.
Preferably, the processing module is further configured to switch the output attribute of the first log type to an off state.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, where the memory stores a computer program, and when the computer program is executed, the electronic device is caused to execute the method of any one of the above first aspects.
In a fourth aspect, an embodiment of the present application provides a storage medium, where the computer-readable storage medium includes a stored program, where when the program runs, the apparatus where the computer-readable storage medium is located is controlled to perform the method described in any one of the above first aspects.
By adopting the scheme provided by the embodiment of the application, the application program is operated, and the first log data is output in the process of operating the application program, wherein the first log data is the data of which the output attribute of the corresponding log type is in the open state, and the first log data is stored. In this way, when the log data is output, only the log data with the output attribute of the corresponding log type in the open state is output, but not all the log data is output, the output attribute of the log type concerned by the user can be set in the open state, and the output attributes of other log types not concerned by the user can be set in the closed state, so that only the log data concerned by the user can be output, the output of the log data not concerned by the operation and maintenance personnel is closed, the query and retrieval efficiency is improved, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a schematic flowchart of a log output method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another log output method according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of another log output method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of log code detection provided in an embodiment of the present application;
fig. 5 is a schematic flowchart of another log output method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a log output device according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of another log output device according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For better understanding of the technical solutions of the present application, the following detailed descriptions of the embodiments of the present application are provided with reference to the accompanying drawings.
It should be understood that the embodiments described are only a few embodiments of the present application, and not all 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 application.
The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the examples of this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that the term "and/or" as used herein is merely one type of associative relationship that describes an associated object, meaning that three types of relationships may exist, e.g., A and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
Before specifically describing the embodiments of the present application, terms applied or likely to be applied to the embodiments of the present application will be explained first.
User experience (UX): which may also be referred to as the UX feature, refers to the user's experience during the shooting process using the electronic device.
Log, refers to log data. The log data is the process event record data generated by the IT system, and the specific user, the specific time, the device or the application system can be known and the specific operation can be performed through the log data.
Currently, in order to analyze program problems in electronic devices, logs need to be output, and by looking at the logs, problems occurring can be located so as to repair defects in programs. Of course, the operation and maintenance personnel can know the operation state of the electronic device by looking up the log, such as the time consumption of the electronic device, the use condition of the processor, and the like. In the prior art, when an electronic device performs log output, logs of all currently running programs need to be output. A large amount of log output needs to use a large log buffer area, and occupies a large amount of system resources, operation and maintenance personnel need to query required log data in a large amount of output logs, the query efficiency is low, and the user experience is poor.
In view of the foregoing problems, embodiments of the present application provide a log output method, apparatus, device and storage medium, in which an application is run in the embodiment of the present application, and in the process of running the application, first log data is output, where the first log data is data whose output attribute of a corresponding log type is in an open state, and the first log data is saved. Therefore, when the log data is output, only the log data with the output attribute of the corresponding log type in the open state is output, but not all the log data is output, the output attribute of the log type concerned by the user can be set in the open state, and the output attributes of other log types not concerned by the user can be set in the closed state, so that only the log data concerned by the user can be output, the output of the log data not concerned by the user is closed, the number of log outputs is greatly reduced, and the query and retrieval efficiency is improved. And the output attribute of the log type of the log data related to the sensitive information of the user can be set to be in a closed state by controlling whether the output attribute of the log type is in the open state or not and controlling the output log data, so that the safety of the user data is improved. The reduction of the number of output log data can reduce the occupancy rate of the processor, so that the operating system of the electronic equipment is more stable. In addition, the consumption of the memory of the electronic equipment can be reduced by reducing the quantity of the output log data, and the data processing effect of the electronic equipment is improved. The details will be described below.
Referring to fig. 1, a schematic flowchart of a log output method provided in an embodiment of the present application is shown. The method comprises the following steps:
and step S101, running the application program.
In the embodiment of the application, after the electronic device is started, the electronic device runs an operating system and displays a main screen in a display interface. When receiving the operation of the application program by the user, the electronic equipment runs the application program.
And step S102, outputting the first log data in the process of running the application program.
The first log data is data of which the output attribute of the corresponding log type is in an open state.
In the embodiment of the application, each log data is preset with a log type to which the log data belongs, and the output attribute of the log type is an attribute for controlling whether the log data of the type is output or not. When the output attribute is in an on state, the electronic device may output the type of log data. When the output attribute is in the closed state, the log data cannot be output, and at the moment, the electronic equipment cannot output the log data of the type. Based on this, in the embodiment of the application, in the process of running the application program, if the log data needs to be output, the electronic device may detect the output attribute of each log type, and output the log data with the output attribute of the log type being in the on state as the first log data.
Further, as shown in fig. 2, before the step S101, the method further includes:
step S103, receiving a first log search command.
Wherein the first log retrieval instruction is to instruct output of log data of a first log type.
In this embodiment, when the user needs the electronic device to output log data of a first log type, a first log search instruction may be transmitted to the electronic device, where the first log search instruction indicates the first log type. The electronic device receives the first log retrieval instruction.
It should be noted that the log type to which each log data belongs is predefined, as shown in table 1 below. The partial log types are listed in table 1 by way of example only, and other types may be included, which is not limited in this application.
TABLE 1
Log scene type Name (R)
Communication scenario a LOG_TYPE_TELE
APP scenario b LOG_TYPE_APP
Stability scenario c LOG_TYPE_STABILITY
Power consumption scenario d LOG_TYPE_POWER
...... ……
Step S104, according to the first log search command, the output attribute of the first log type is switched to the on state.
In this embodiment of the application, after receiving the first log retrieval instruction, the electronic device may obtain the first log type by analyzing the first log retrieval instruction, and switch the output attribute of the first log type to the on state.
It should be noted that, in the embodiment of the present application, the output attributes of all log types default to the off state. At this time, the electronic apparatus cannot output log data without switching the output attribute of the log type from the off state to the on state. When the user needs to output the log data of the first log type, the electronic device updates the output attribute of the first log type indicated in the first log retrieval instruction to the on state, so that the electronic device can output the log data of the first log type during normal operation.
Further, the first log type includes any one of a communication type, an application type, a stability type, and a power consumption type.
It should be noted that the first log type may also be other types, for example, a user scene type, which is not limited in this application.
In this case, the step S102, in the process of running the application program, outputting the first log data includes: in the course of running the application program, log data of a first log type is output as first log data.
That is, the electronic device determines the first log type, then changes the log data of the first log type into the first log data, and outputs the first log data when the log data is subsequently output.
Illustratively, the user needs to obtain log data of the communication type. At this time, the user transmits a first log retrieval instruction to the electronic device, which instructs to output log data of the communication type. And after receiving the first log retrieval instruction, the electronic equipment switches the output attribute of the communication type to an open state. The electronic equipment normally runs the application program, and in the process of running the application program, the log data of the communication type is output as first log data, and the first log data is stored for the subsequent viewing of a user.
Further, after the step S102, the method may further include: the outputted first log data is saved. That is, the electronic device may save the output first log data so that the user can view the first log data.
Fig. 3 is a schematic flowchart illustrating another log output method according to an embodiment of the present application. The difference between the embodiment shown in fig. 3 and the above-described embodiments is only that whether the logging rule is met in the code added with the detection log. The method is specifically as follows.
Step S301, detecting a code for generating the log according to a preset log rule.
The log rule is preset and is used for standardizing the rule of the log code, and at least one rule which is required to be met by the log code is recorded in the log rule.
In the embodiment of the application, a user presets a log rule, and after the electronic device acquires the log rule, the electronic device can scan and detect the codes of the log according to the log rule and find out the code statements which do not meet the log rule in the codes. That is, after the electronic device obtains the log rule, the electronic device may scan the log code of the code repository, and detect whether the log code meets the log rule.
Further, the preset logging rule comprises that the code for generating the log does not contain sensitive information of the user, and/or the code for generating the log contains related codes for representing log types of the log data required by the log data.
In the embodiment of the application, when the preset log rule includes that the code for generating the log does not contain the sensitive information of the user, the part of the log code containing the sensitive information of the user can be deleted, the output log data is ensured not to contain the sensitive information of the user, and the safety of the user information is improved.
When the preset log rule comprises that the codes for generating the log comprise related codes of the log types representing the types required by the log data, the log data can be divided into different log types, so that in the subsequent steps, a user can control the output of the log data of different log types, and all log data do not need to be output every time.
It should be noted that the user sensitive information refers to all information that is not properly used or is not authorized to be contacted or modified by a person, which is not favorable for the privacy rights of the person, and may include the identity information, communication information, financial related information, and the like of the user. The user can preset according to actual requirements, and the application is not limited to this.
Further, the presetting of the log rule further comprises: the Log of the Verbose level is not required to appear in the user version, and/or the Log of the Debug level is not started by default, and is started through an electronic device command, and/or if condition judgment must be added to the Log statement, and/or the Log output must realize an islogable interface, and/or operation cannot appear in the Log statement, and the like.
Step S302, identifying codes which do not accord with the preset log rule in the codes, and generating a log detection report, wherein the codes which do not accord with the preset log rule are recorded in the log detection report.
In the embodiment of the application, after detecting statements that do not meet the log rule in the codes of the log, the electronic device may generate a log detection report from the detected statements, where the log detection report records the statements that do not meet the log rule in the log codes.
Furthermore, the electronic device may generate a log detection report according to all statements that do not meet the log rule after completing the code detection of the whole log. That is, if the log statement does not conform to the log rule, the log statement is identified, and after the scanning is finished, a log detection report is generated, as shown in fig. 4.
Step S303, sending a log detection report to the user.
In the embodiment of the application, after a user formulates a log rule, and the electronic equipment finds out statements which do not accord with the log rule in a log code, a log detection report is generated, and the log detection report is sent to the user. Therefore, a user can know which statements in the log codes do not accord with the log rules through the log detection report, and further can correspondingly modify and adjust the statements so that the modified log codes accord with the log rules.
And scanning the codes of the log according to the log rule, and identifying the log statements which do not accord with the log rule. For example, a log statement to which an output attribute of a log type is not added, log data output in a loop, and the like. The log statements which do not accord with the log rule are identified, and a log detection report is generated and fed back to the relevant user for adjustment, so that the relevant user can know how many log statements of which files violate the log rule through the log detection report, the problem is directly positioned, the time of the relevant user can be greatly reduced, the relevant user is efficiently helped to modify the module code, and the relevant user is facilitated to monitor the code quality.
Step S304, receiving a first log search command.
Wherein the first log retrieval instruction is to instruct output of log data of a first log type.
Specifically, refer to step S104, which is not described herein again.
In step S305, the output attribute of the first log type is switched to the on state in accordance with the first log search command.
Specifically, refer to step S105, which is not described herein again.
And step S306, running the application program.
Specifically, refer to step S101, which is not described herein again.
In step S307, the first log data is output while the application is running.
The first log data is data of which the output attribute of the corresponding log type is in an open state.
Specifically, refer to step S102, which is not described herein again.
Fig. 5 is a schematic flowchart illustrating another log output method according to an embodiment of the present application. The embodiment shown in fig. 5 differs from the above embodiments only in that the output attribute correlation step for all log types is set before the first log retrieval instruction is received. The method is specifically as follows.
Step S501, detecting a code for generating the log according to a preset log rule.
Specifically, refer to step S301, which is not described herein again.
Step S502, according to the first log search command, the output attribute of the first log type is switched to the on state.
Specifically, refer to step S302, which is not described herein again.
Step S503, sending a log detection report to the user.
Specifically, refer to step S303, which is not described herein again.
And step S504, setting the output attributes of the first log type and other log types to be in a closed state.
Wherein the other log types are log types other than the first log type and include at least a second log type.
In the embodiment of the application, the electronic device can set the output attributes of all log types contained in the electronic device to be in the closed state during initial operation. That is, the electronic device does not output any log data.
Step S505 receives a first log search command.
Specifically, refer to step S104, which is not described herein again.
Step S506, according to the first log search command, the output attribute of the first log type is switched to an open state.
Specifically, refer to step S105, which is not described herein again.
And step S507, running the application program.
Specifically, refer to step S101, which is not described herein again.
In step S508, the first log data is output during the running of the application.
The first log data is data of which the output attribute of the corresponding log type is in an open state.
Specifically, refer to step S102, which is not described herein again.
In step S509, the output attribute of the first log type is switched to the off state.
In the embodiment of the application, after the electronic device contains the first log data, the output attribute of the first log type can be switched to the closed state, so that the log data which is not concerned by a user can be prevented from being output in the subsequent operation process.
It should be noted that the log output method described in the embodiment of the present application may be applied to an android system, and may also be applied to other operating systems, for example, a kaios operating system or a yoto system.
On the first hand, in the process of integrating the android system, android log data are often required to be captured to analyze problems, and many debugging logs are required to be added in codes to monitor the running of software and analyze the defects of the software to locate problem modules. The Logd process is responsible for storing various log information of the electronic device into different log buffers. However, the space of the log buffer is limited, and in the prior art, when the log data is output, all log data is output, so that a large amount of log data is output to the log buffer, and the log buffer is easily filled up, thereby triggering a log rollback mechanism, and covering the large amount of output log data. Based on this, in the embodiment of the present application, in the process of running the application program, the first log data is output, where the first log data is data whose corresponding log type output attribute is in an open state, and the first log data is saved. Therefore, when the log data is output, only the log data with the output attribute of the corresponding log type in the open state is output, but not all the log data is output, the output attribute of the log type concerned by the user can be set in the open state, and the output attributes of other log types not concerned by the user can be set in the closed state, so that only the log data concerned by the user can be output, the output of the log data not concerned by the user is closed, the number of log outputs is greatly reduced, and the query and retrieval efficiency is improved.
In the second aspect, since information output concerning the privacy of the log sometimes occurs in the development log, leakage of user information is caused. In the embodiment of the application, whether the log data is output or not is determined by checking whether the output attribute of the log type is in the open state or not, and the output attribute of the log type of the log data of the user sensitive information can be set to be in the closed state in the user version, so that the log data of the user sensitive information cannot be output, and the safety of the user data can be improved.
In the third aspect, the processor of the system is frequently occupied, which is easy to cause the stability problem of the system. The Logd process is responsible for capturing various log information in the electronic equipment, and frequent output of log data can aggravate occupation of the Logd on the processor and influence stability of the system. In the application, only the log data with the output attribute of the corresponding log type in the open state is output, and other log data is not output, so that the occupancy rate of a system processor can be reduced, and the stability of the system can be improved.
In the fourth aspect, when log data is output, the electronic device needs to open up a memory space to store the log data, and sometimes the size of the log buffer has to be increased in order to store more log data, which increases the consumption of the memory. The log data output is too much, and a large system memory is occupied, so that the system memory space is wasted. In the embodiment of the application, only the log data with the output attribute of the corresponding log type being in the open state is output, and other log data are not output, so that the log cache space can be effectively utilized, the occupied memory space is reduced, and the data processing efficiency of the electronic equipment is improved.
Fig. 6 is a schematic structural diagram of a log output apparatus according to an embodiment of the present application. As shown in fig. 6, the apparatus includes:
the processing module 601 is configured to run an application.
An output module 602, configured to output the first log data when the application is running.
The first log data is data of which the output attribute of the corresponding log type is in an open state.
Further, as shown in fig. 7, the log output device further includes:
the receiving module 603 is configured to receive a first log retrieving instruction.
Wherein the first log retrieval instruction is to instruct output of log data of a first log type.
The processing module 601 is further configured to switch the output attribute of the first log type to an on state according to the first log search instruction.
Further, the processing module 601 is further configured to set the output attributes of the first log type and the other log types to the off state.
Wherein the other log types are log types other than the first log type and include at least a second log type.
Further, the first log type includes any one of a communication type, an application type, a stability type, and a power consumption type.
Further, referring to fig. 7, the log output apparatus further includes: a sending module 605. Wherein the content of the first and second substances,
the processing module 601 is further configured to detect a code for generating a log according to a preset log rule.
The processing module 601 is further configured to identify a code that does not meet a preset log rule in the codes, and generate a log detection report.
And codes which do not accord with the preset log rule are recorded in the log detection report.
A sending module 604, configured to send a log detection report to a user.
Further, the preset logging rule comprises that the code for generating the log does not contain sensitive information of the user, and/or the code for generating the log contains related codes for representing log types of the log data required by the log data.
Further, the processing module 601 is further configured to switch the output attribute of the first log type to an off state.
Corresponding to the embodiment, the application further provides the electronic equipment. Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device 800 may include: a processor 801, a memory 802, and a communication unit 803. The components communicate over one or more buses, and those skilled in the art will appreciate that the configuration of the servers shown in the figures are not meant to limit embodiments of the present invention, and may be in the form of buses, stars, more or fewer components than those shown, some components in combination, or a different arrangement of components.
The communication unit 803 is configured to establish a communication channel so that the storage device can communicate with other devices. Receiving the user data sent by other devices or sending the user data to other devices.
The processor 801, which is a control center of the storage device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and/or processes data by operating or executing software programs and/or modules stored in the memory 802 and calling data stored in the memory. The processor may be composed of Integrated Circuits (ICs), for example, a single packaged IC, or a plurality of packaged ICs connected to the same or different functions. For example, the processor 801 may include only a Central Processing Unit (CPU). In the embodiment of the present invention, the CPU may be a single operation core, or may include multiple operation cores.
The memory 802, for storing instructions executed by the processor 801, may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The execution of the instructions in the memory 802, when executed by the processor 801, enables the electronic device 800 to perform some or all of the steps in the embodiment shown in fig. 5.
In specific implementation, the present invention further provides a computer storage medium, where the computer storage medium may store a program, and the program may include some or all of the steps in the embodiments of the log output method provided by the present invention when executed. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a Random Access Memory (RAM), or the like.
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The same and similar parts in the various embodiments in this specification may be referred to each other. Especially, as for the device embodiment and the terminal embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant points can be referred to the description in the method embodiment.

Claims (14)

1. A log output method, comprising:
running an application program;
and outputting first log data in the process of running the application program, wherein the first log data is data of which the output attribute of the corresponding log type is in an open state.
2. The method of claim 1, prior to the running the application, further comprising:
receiving a first log retrieval instruction; the first log retrieval instruction is used for indicating to output log data of a first log type;
switching an output attribute of a first log type to an on state according to the first log retrieval instruction;
the outputting the first log data during the running of the application program comprises:
in the course of running the application program, log data of a first log type is output as first log data.
3. The method of claim 2, prior to said receiving a first log retrieval instruction, further comprising:
setting output attributes of the first log type and the other log types to be in a closed state; wherein the other log types are log types other than the first log type and include at least a second log type.
4. The method of claim 2, wherein the first log type comprises any one of a communication type, an application type, a stability type, and a power consumption type.
5. The method of claim 2, prior to said receiving a first log retrieval instruction, further comprising:
detecting a code for generating a log according to a preset log rule;
identifying codes which do not accord with a preset log rule in the codes, and generating a log detection report, wherein the codes which do not accord with the preset log rule are recorded in the log detection report;
and sending the log detection report to a user.
6. The method according to claim 5, wherein the preset logging rule comprises that the code for generating the log does not contain sensitive information of the user, and/or the code for generating the log contains related code for characterizing the log type of the log data of the required type.
7. The method according to claim 2, wherein after outputting the first log data during the running of the application program, further comprising:
an output attribute of the first log type is switched to an off state.
8. A log output apparatus, comprising:
the processing module is used for running the application program;
and the output module is used for outputting first log data when the application program is operated, wherein the first log data is data of which the corresponding log type has the output attribute in an open state.
9. The apparatus of claim 8, further comprising:
the receiving module is used for receiving a first log retrieval instruction; the first log retrieval instruction is used for indicating to output log data of a first log type;
the processing module is further configured to switch an output attribute of the first log type to an on state according to the first log retrieval instruction.
10. The apparatus of claim 9,
the processing module is also used for setting the output attributes of the first log type and other log types to be in a closed state; wherein the other log types are log types other than the first log type and include at least a second log type.
11. The apparatus of claim 9, further comprising: a sending module; wherein the content of the first and second substances,
the processing module is also used for detecting a code for generating the log according to a preset log rule;
the processing module is further used for identifying codes which do not accord with the preset log rule in the codes and generating a log detection report, wherein the codes which do not accord with the preset log rule are recorded in the log detection report;
and the sending module is used for sending the log detection report to a user.
12. The apparatus of claim 9,
the processing module is further configured to switch the output attribute of the first log type to an off state.
13. An electronic device, comprising a processor and a memory, the memory storing a computer program that, when executed, causes the electronic device to perform the method of any of claims 1-7.
14. A storage medium, comprising a stored program, wherein the program, when executed, controls an apparatus in which the computer-readable storage medium resides to perform the method of any one of claims 1-7.
CN202111093469.0A 2021-09-17 2021-09-17 Log output method, device, setting and storage medium Pending CN113778952A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111093469.0A CN113778952A (en) 2021-09-17 2021-09-17 Log output method, device, setting and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111093469.0A CN113778952A (en) 2021-09-17 2021-09-17 Log output method, device, setting and storage medium

Publications (1)

Publication Number Publication Date
CN113778952A true CN113778952A (en) 2021-12-10

Family

ID=78851795

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111093469.0A Pending CN113778952A (en) 2021-09-17 2021-09-17 Log output method, device, setting and storage medium

Country Status (1)

Country Link
CN (1) CN113778952A (en)

Similar Documents

Publication Publication Date Title
US9336054B2 (en) Method and apparatus for configuring resource
CN104268055B (en) The monitoring method and device of a kind of program exception
US8370816B2 (en) Device, method and computer program product for evaluating a debugger script
CN108197032B (en) Main thread jamming monitoring method, medium, equipment and system for IOS application
US20060150023A1 (en) Debugging apparatus
CN106155883A (en) A kind of virtual machine method for testing reliability and device
CN111353143A (en) Sensitive authority detection method and device and storage medium
CN110633190B (en) Application program memory monitoring method, device, equipment and storage medium
CN111061448A (en) Log information display method and device, electronic equipment and storage medium
CN109960658B (en) Application programming interface testing method and device, electronic equipment and storage medium
CN115407943A (en) Memory dump file generation method, device and equipment and readable storage medium
CN111147331A (en) Server network card interaction test method, system, terminal and storage medium
CN110764962A (en) Log processing method and device
CN113778952A (en) Log output method, device, setting and storage medium
CN109783261B (en) Crash processing method and device for terminal application, electronic equipment and storage medium
CN115658500A (en) Vue-based front-end error log uploading method and system in hybrid development
JP5116606B2 (en) Software analysis system
CN113468020A (en) Memory monitoring method and device, electronic equipment and computer readable storage medium
CN107506271A (en) A kind of method of testing and device
CN106610878A (en) Fault debugging method for dual-controller system
CN113760450A (en) Automatic safety management method and device for private cloud virtual machine, terminal and storage medium
CN114253825A (en) Memory leak detection method and device, computer equipment and storage medium
JP4339269B2 (en) Mobile phone bus monitor system and method
CN112732568B (en) System log acquisition method and device, storage medium and terminal
JPH11134204A (en) Stack protecting device

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