SYS_Log.clear() method
清空日志
签名
typescript
function clear(): void;1
返回值
void
示例
javascript
// 1. 先写入几条示例日志,让清空效果可见
eda.sys_Log.add('嘉立创示例_清空前日志 1');
eda.sys_Log.add('嘉立创示例_清空前日志 2', 'warn');
const before = await eda.sys_Log.sort();
console.log('清空前的日志条目数:', before.length);
// 2. 清空日志面板(同步调用,立即生效)
eda.sys_Log.clear();
// 3. 再次查询,确认面板已清空
const after = await eda.sys_Log.sort();
console.log('清空后的日志条目数:', after.length);1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12