Mobile banking log uploading method based on CocoLumberjack

Through the mobile banking log upload method based on CocoaLumberjack, the problem of bug positioning difficulties in mobile banking is solved, and the rapid upload and classification of logs is realized, which improves development efficiency and user experience.

CN119172232APending Publication Date: 2024-12-20BEIYIN FINANCIAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411276676.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

During the use of mobile banking, due to differences in the mobile system version, mobile phone model and network environment, bugs are difficult to quickly locate and resolve, affecting the user experience. Developers need to understand detailed usage scenarios and log information in order to quickly locate and fix bugs. .

Method used

Adopt the mobile banking log upload method based on CocoaLumberjack, including initializing the log output method, setting the log generation format and uploading network address, replacing the system NSLog log, defining the log type according to the log level, setting the log recording cycle and storage conditions, and compressing when running in the background And upload the log, use fishhook to replace NSLog, use DDFileLogger and GCD queue to manage log writing operations, and implement log classification and rollback notifications.

Benefits of technology

Through the CocoaLumberjack log upload method, developers can quickly obtain and upload logs, reduce AppDelegate volume, aggregate and separate logs, realize competition-free log writing and flexible log operations, improve bug positioning and resolution efficiency, and improve user experience .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172232A_ABST
    Figure CN119172232A_ABST
Patent Text Reader

Abstract

The invention discloses a mobile phone banking log uploading method based on CocoaLumberjack. The log uploading method comprises the following steps: carrying out log uploading based on the CocoaLumberjack, carrying out log uploading on the basis of the CocoaLumberjack, and carrying out log uploading on the basis of the CocoaLumberjack; a format during log generation is set, an uploading network address is set, and an NSLog of the system is replaced; the method comprises the following steps: defining a log type according to a CocoLumberjack log level, and archiving and marking a generated log; and when the app enters the background to run, compressing the log and uploading the compressed log at the same time. And a developer can maintain the output of the basic log by using a previous use mode conveniently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of mobile banking, and in particular to a mobile banking log uploading method based on CocoaLumberjack. Background Art

[0002] When users use mobile banking, some functions may not be available due to the order of business operations, different mobile phone system versions, different mobile phone models, and different network environments. We call these problems bugs. These bugs seriously affect the user experience. In order to solve these bugs, developers need to understand the specific and detailed usage scenarios to effectively solve such bugs. For developers, it is particularly important to quickly obtain the log files of mobile banking. With the log files, developers can reproduce the actions associated with users doing business in mobile banking, know the environment when mobile banking is running, and view the context information of the code. Based on this key information, developers can quickly locate and solve bugs.

[0003] 1. The user proactively reports the bug information, and the user's mobile phone is linked to the development tool. The user manually reproduces the problem scenario and displays the log through the terminal platform.

[0004] 2. The user obtains the user's mobile phone operation log library through the tool, uses the terminal platform to open the mobile banking log file, and displays the log.

[0005] 3. Purchase a third-party log service platform, pay for access, and check the log status on the service platform. Summary of the invention

[0006] In view of the above problems, the present invention is proposed to provide a mobile banking log uploading method based on CocoaLumberjack that overcomes the above problems or at least partially solves the above problems.

[0007] According to one aspect of the present invention, a method for uploading a mobile banking log based on CocoaLumberjack is provided, and the method for uploading a log includes:

[0008] Based on CocoaLumberjack log upload;

[0009] Set the format for log generation, set the upload network address, and replace the system's NSLog log;

[0010] Define the log type according to the CocoaLumberjack log level and mark the generated log archive;

[0011] When the app enters the background, the logs are compressed and uploaded.

[0012] Optionally, the CocoaLumberjack-based log upload specifically includes: initializing the CocoaLumberjack log output mode when the app is started.

[0013] Optionally, the log uploading method further includes:

[0014] Use fishhook to replace the system NSLog with `DDLogVerbose` in DDLog to complete log debugging recording.

[0015] Optionally, the log type is defined according to the CocoaLumberjack log level and further includes:

[0016] Set the log recording period, the maximum value of the log file storage, the total number of log files, and the total log file storage size.

[0017] Optionally, defining the log type according to the CocoaLumberjack log level specifically includes:

[0018] Initialize and use CocoaLumberjack's DDLogFormatter to set the basic information of each log header, including timestamp, method name, and log line.

[0019] Optionally, the log uploading method further includes:

[0020] Use DDFileLogger to operate files, including opening and closing log files, obtaining log file information, and determining whether rollback conditions are met when log writing to the file is finished. If rollback conditions are met, use the proxy to send rollback notifications.

[0021] The log write operation is in a pending state.

[0022] Optionally, the log uploading method further includes: when the log is input into a file, using a GCD queue to manage the actions of writing all logs into the file.

[0023] The present invention provides a method for uploading mobile banking logs based on CocoaLumberjack, and the method includes: uploading logs based on CocoaLumberjack; setting the format of log generation, setting the upload network address, and replacing the system's NSLog log; defining the log type according to the CocoaLumberjack log level, and marking the generated log for archiving; and compressing the logs and uploading the compressed logs when the app enters the background. This is convenient for developers to continue using the previous usage method and maintain the output of basic logs.

[0024] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0026] Figure 1 A flowchart of a mobile banking log uploading method based on CocoaLumberjack provided in an embodiment of the present invention;

[0027] Figure 2 A schematic diagram of introducing a subagent based on CocoaLumberjack when starting an app provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0028] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0029] The terms "comprises" and "having" and any variations thereof in the description embodiments, claims and drawings of the present invention are intended to cover non-exclusive inclusions, for example, including a series of steps or units.

[0030] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0031] like Figure 1 As shown, a method for uploading mobile banking logs based on CocoaLumberjack includes:

[0032] Based on CocoaLumberjack log upload, when the app starts, the CocoaLumberjack log output method is initialized, the format of log generation is set, the upload network address is set, the system NSLog log is replaced, the log type is defined according to the CocoaLumberjack log level, the log recording period, the maximum storage value of the log file, the total number of log files, the total storage size of the log files are set, the generated log is marked for archiving, and the log is compressed and uploaded when the app enters the background.

[0033] 1. Use fishhook to replace the system NSLog with `DDLogVerbose` in DDLog to complete the log debugging record

[0034] 2. When the app starts, a subagent based on CocoaLumberjack is introduced. This agent is AppDelegate. The subagent performs the methods of the entire application life cycle. The CocoaLumberjack initialization is completed in the subagent, and the app enters the background monitoring, that is, the notification can be obtained when the app enters the background. ( Figure 2 )

[0035] 3. Initialize and use CocoaLumberjack's DDLogFormatter to set the basic information of each log header, including timestamp, method name, and log line.

[0036] 4. Initialize and use CocoaLumberjack's DDFileLogger to set the rollback conditions of the log file, such as the log interval, number of files, maximum file storage size, and total log storage size.

[0037] 5. Use CocoaLumberjack's DDLog tags to classify logs, including network data logs, debug print logs, page life cycle logs, app and H5 interaction logs, and crash logs.

[0038] 6. Based on the function type, the corresponding function log is implanted in the basic class of each module. The business page can record without implantation to achieve the aggregation effect.

[0039] 7. Use DDFileLogger to operate files, including opening log files, closing log files, obtaining log file information, and judging whether the rollback condition is met when the log is written to the file. If the rollback condition is met, use the proxy to send a rollback notification. The log writing operation is in a waiting state.

[0040] 8. When inputting logs into files, avoid competition and use GCD queues to manage all actions of writing logs to files.

[0041] 9. Receive the rollback notification and immediately use SSZipArchive to compress the log file. After the compression is successful, delete the log file, create a new log file, start log writing, encrypt the compressed file and upload the compressed file. After the upload is successful, delete the compressed file.

[0042] 10. After receiving the notification that the APP enters the background monitoring, use SSZipArchive to compress and encrypt the log file. After success, delete the original log file, compress it and use the system API<sys / xattr.h> The setxattr method configures archiving and enables uploading of compressed archive log files. After successful upload, the compressed files are deleted.

[0043] Beneficial effects: 1. CocoaLumberjack's `DDLogVerbose` is replaced with the system log NSLog, which is convenient for developers to use the previous method and maintain the output of basic logs.

[0044] 2. Introduce CocoaLumberjack log to reduce AppDelegate volume

[0045] 3. Multiplex logs, aggregate logs, separate them from business debugging logs, and view logs clearly.

[0046] 4. Flexibly operate the log files and log folders in the sandbox of mobile banking, such as creating log files, opening log files, archiving logs, and saving logs.

[0047] 5. When multiple business modules use CocoaLumberjack to write logs, they are written in order without competition.

[0048] 6. When rolling back, obtain the size and creation time of the log file, the size of the log folder, and the sending of the rollback notification.

[0049] 7. When receiving the rollback notification, the log file is compressed, the log compressed file is encrypted, and the log is uploaded.

[0050] 8. When receiving background notification from the app, compress the log file, encrypt the compressed log file, and upload the log.

[0051] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A mobile banking log upload method based on CocoaLumberjack, It is characterized in that The log uploading method includes: Based on CocoaLumberjack log upload; Set the format for log generation, set the upload network address, and replace the system's NSLog log; Define the log type according to the CocoaLumberjack log level and mark the generated log archive; When the app enters the background, the logs are compressed and uploaded.

2. A method for uploading mobile banking logs based on CocoaLumberjack according to claim 1, It is characterized in that The CocoaLumberjack-based log upload specifically includes: initializing the CocoaLumberjack log output mode when the app is started.

3. A method for uploading mobile banking logs based on CocoaLumberjack according to claim 1, It is characterized in that The log uploading method further includes: Use fishhook to replace the system NSLog with `DDLogVerbose` in DDLog to complete log debugging recording.

4. A method for uploading mobile banking logs based on CocoaLumberjack according to claim 1, It is characterized in that Defining the log type according to the CocoaLumberjack log level also includes: Set the log recording period, the maximum value of the log file storage, the total number of log files, and the total log file storage size.

5. A method for uploading mobile banking logs based on CocoaLumberjack according to claim 1, It is characterized in that The log type defined according to the CocoaLumberjack log level specifically includes: Initialize and use CocoaLumberjack's DDLogFormatter to set the basic information of each log header, including timestamp, method name, and log line.

6. A method for uploading mobile banking logs based on CocoaLumberjack according to claim 1, It is characterized in that The log uploading method further includes: Use DDFileLogger to operate files, including opening and closing log files, obtaining log file information, and determining whether rollback conditions are met when log writing to the file is finished. If rollback conditions are met, use the proxy to send rollback notifications. The log write operation is in a pending state.

7. A method for uploading mobile banking logs based on CocoaLumberjack according to claim 1, It is characterized in that The log uploading method further includes: when the log is input into the file, using the GCD queue to manage the action of writing all the logs into the file.