{"id":24092396,"url":"https://github.com/armink-rtt-pkgs/ulog_easyflash","last_synced_at":"2025-09-17T01:33:59.910Z","repository":{"id":56277591,"uuid":"154251609","full_name":"armink-rtt-pkgs/ulog_easyflash","owner":"armink-rtt-pkgs","description":"The ulog flash plugin by EasyFlash. | 基于 EasyFlash 的 ulog 插件","archived":false,"fork":false,"pushed_at":"2023-11-24T09:29:47.000Z","size":24,"stargazers_count":13,"open_issues_count":1,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-10T07:51:53.372Z","etag":null,"topics":["backend","easyflash","ulog"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/armink-rtt-pkgs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-23T02:49:23.000Z","updated_at":"2023-11-24T09:29:52.000Z","dependencies_parsed_at":"2023-01-30T00:01:11.955Z","dependency_job_id":null,"html_url":"https://github.com/armink-rtt-pkgs/ulog_easyflash","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/armink-rtt-pkgs/ulog_easyflash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armink-rtt-pkgs%2Fulog_easyflash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armink-rtt-pkgs%2Fulog_easyflash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armink-rtt-pkgs%2Fulog_easyflash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armink-rtt-pkgs%2Fulog_easyflash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/armink-rtt-pkgs","download_url":"https://codeload.github.com/armink-rtt-pkgs/ulog_easyflash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armink-rtt-pkgs%2Fulog_easyflash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275520378,"owners_count":25479603,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-16T02:00:10.229Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","easyflash","ulog"],"created_at":"2025-01-10T07:44:58.906Z","updated_at":"2025-09-17T01:33:59.639Z","avatar_url":"https://github.com/armink-rtt-pkgs.png","language":"C","funding_links":[],"categories":["Packages"],"sub_categories":["Tools"],"readme":"# Ulog plugin based on EasyFlash\n\n[中文页](README_ZH.md) | English\n\n## 1. Introduction\n\nulog is a brand new log component of RT-Thread. Its front-end and back-end separation design allows more back-ends to be easily connected. This software package mainly implements the two functions of **ulog's Flash backend** and **ulog's filter parameter storage**. Its bottom layer is based on the Flash flash library [EasyFlash](https://github.com/armink) /EasyFlash) makes it easy to save logs and filter parameters from ulog on Flash. Its main features are as follows:\n\n- Small resource occupation, seamless connection with ENV and LOG functions of EasyFlash;\n- Logs are stored in a circular replacement method. When the log partition is full, the oldest log will be automatically deleted;\n- The stored history log can be read into the RT-Thread console for easy reading and debugging;\n- Optionally read a part of recent logs to the RT-Thread console;\n- Automatically load the saved ulog filter parameters at startup;\n- All functions provide Finsh/MSH commands, support: log reading, log cleaning, saving filter parameters.\n\n### 1.1 License\n\nThis package complies with the MIT license, see the `LICENSE` file for details.\n\n### 1.2 Dependency\n\n- RT-Thread 3.1.1+\n- EasyFlash 3.0.0+\n\n## 2. How to open\n\nTo use this package, you need to select it in the package manager of RT-Thread. The specific path is as follows:\n\n```\nRT-Thread online packages\n    tools packages ---\u003e\n        [*] ulog_easyflash: The ulog flash plugin by EasyFlash.\n            [*] Enable the flash backend for ulog\n            [*] Save the ulog filter configuration to flash\n            Version (latest) ---\u003e\n```\n\n- `Enable the flash backend for ulog`: Enable the flash backend function of ulog;\n- `Save the ulog filter configuration to flash`: Turn on the function of saving ulog filter parameters.\n\nThen let RT-Thread's package manager automatically update, or use the `pkgs --update` command to update the package to the BSP.\n\n\u003e **Note**:\n\u003e\n\u003e- If the LOG function of EasyFlash has not been enabled before, after opening this software package, you need to configure the log area size in the EasyFlash options. The configuration name is: Saved log area size.\n\u003e- Before using the function of saving filter parameters, ensure that the runtime filter function is enabled on the ulog side, and the configuration name is: Enable runtime log filter.\n\n## 3. Instructions for use\n\n### 3.1 Flash backend initialization\n\nYou need to call the initialization function `ulog_ef_backend_init()` at the application layer. If the project enables automatic component initialization, even this function does not need to be called. The component initialization function has been added to this function in the software package.\n\n### 3.2 Set Flash log save level\n\nThrough this function: `void ulog_ef_log_lvl_set(rt_uint32_t level)`, you can set the log level you want to save to Flash. Logs below this level will be **discarded**. Example: To set to save only the logs at the warning level and above, you can execute the following code:\n\n```c\nulog_ef_log_lvl_set(LOG_LVL_WARNING);\n```\n\n### 3.3 Load ulog filter parameters\n\nThrough this function: `void ulog_ef_filter_cfg_load(void)`, you can reprint the ulog filtering parameters already stored in Flash. If the project has enabled component auto-initialization, this function will run automatically upon power-up.\n\n### 3.4 Save ulog filter parameters\n\nThrough this function: `void ulog_ef_filter_cfg_save(void)`, you can save the filtering parameters that ulog has set to flash. This function also has a corresponding Finsh/MSH command: `ulog_filter_save`. When you need to save, just execute it.\n\n### 3.5 Use of Finsh/MSH commands\n\nThe command format related to Flash log is `ulog_flash \u003cread|clean\u003e`\n\n#### 3.5.1 Historical log reading\n\nAfter the history log is saved in Flash, it can be read to the console through the following command, which is convenient for developers to review the log and analyze the problem.\n\n- To read all historical logs, enter the command: `ulog_flash read`\n\n```shell\nmsh /\u003eulog_flash read\n10-23 10:28:51.618 D/example tshell: LOG_D(1): RT-Thread is an open source IoT operating system from China.\n10-23 10:28:51.618 I/example tshell: LOG_I(1): RT-Thread is an open source IoT\n......\nmsh /\u003e\n```\n\n- To read the recent 200-byte log, enter the command: `ulog_flash read 200`\n\n```shell\nmsh /\u003eulog_flash read 200\nlog_w(50): RT-Thread is an open source IoT operating system from China.\n10-23 19:37:05.137 E/test tshell: ulog_e(50): RT-Thread is an open source IoT operating system from China.\n\nmsh /\u003e\n```\n\n#### 3.5.2 Clear history log\n\nWhen you need to clear all historical logs in the log area, you can enter the command: `ulog_flash clean`\n\n```shell\nmsh /\u003eulog_flash clean\n10-24 10:00:22.307 I/easyflash tshell: All logs which in flash is clean OK.\nmsh /\u003e\n```\n\nWait for a while, the log cleaning is complete, a prompt of successful cleaning will be displayed.\n\n#### 3.5.3 Save ulog filter parameters to Flash\n\nIn the debugging and development process, after the ulog filter parameters are set, if you need to save, you can enter the command: `ulog_filter_save`. After saving, restart and use the `ulog_filter` command again, you can see the previously saved filter parameters.\n\n```shell\nmsh /\u003eulog_filter_save\n[Flash] (../packages/EasyFlash-latest/src/ef_env.c:821) Calculate ENV CRC32 number is 0x10C41F91.\n[Flash] (../packages/EasyFlash-latest/src/ef_env.c:774) Erased ENV OK.\n[Flash] (../packages/EasyFlash-latest/src/ef_env.c:788) Saved ENV OK.\nmsh /\u003e\n```\n\n## 4. Matters needing attention\n\n- Before using this package, make sure that the dependent options are opened in advance, otherwise the options cannot be seen in menuconfig.\n\n## 5. Contact \u0026 Thanks\n\n* Maintenance: [armink](https://github.com/armink)\n* Homepage: https://github.com/armink-rtt-pkgs/ulog_easyflash\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmink-rtt-pkgs%2Fulog_easyflash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farmink-rtt-pkgs%2Fulog_easyflash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmink-rtt-pkgs%2Fulog_easyflash/lists"}