feat(stdlib): Mid2 M10 stats and log fields

Add thin mean/median/stdev and optional structured fields on log
lines; close Mid2 M7–M10 (zip skipped).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-09 09:42:13 +08:00
1 parent 955834e453
commit 784d5ec346
22 files changed
+394 -32

No files matched your search

+9 -5
View File
@@ -1,6 +1,6 @@
---
title: lib/log
description: Level-filtered one-line logs (Mid M6). Default level info.
description: Level-filtered one-line logs (Mid M6 + Mid2 M10 fields). Default level info.
---
## set_level
@@ -12,8 +12,9 @@ level is debug / info / warn / error.
## debug
+ `text`
+ `fields`=None
*line = > host_log_line level="debug" text=`text`*
*line = > host_log_line level="debug" text=`text` fields=`fields`*
1. `line`
> print text=`line`
2. *
@@ -21,8 +22,9 @@ level is debug / info / warn / error.
## info
+ `text`
+ `fields`=None
*line = > host_log_line level="info" text=`text`*
*line = > host_log_line level="info" text=`text` fields=`fields`*
1. `line`
> print text=`line`
2. *
@@ -30,8 +32,9 @@ level is debug / info / warn / error.
## warn
+ `text`
+ `fields`=None
*line = > host_log_line level="warn" text=`text`*
*line = > host_log_line level="warn" text=`text` fields=`fields`*
1. `line`
> print text=`line`
2. *
@@ -39,8 +42,9 @@ level is debug / info / warn / error.
## error
+ `text`
+ `fields`=None
*line = > host_log_line level="error" text=`text`*
*line = > host_log_line level="error" text=`text` fields=`fields`*
1. `line`
> print text=`line`
2. *
+21
View File
@@ -0,0 +1,21 @@
---
title: lib/stats
description: Thin mean / median / sample stdev (Mid2 M10). Not a dataframe library.
---
## mean
+ `list`
**> host_stats_mean list=`list`**
## median
+ `list`
**> host_stats_median list=`list`**
## stdev
+ `list`
Sample standard deviation; needs at least two values.
**> host_stats_stdev list=`list`**
+9 -5
View File
@@ -1,6 +1,6 @@
---
title: lib/日志
description: 按级别过滤的一行日志(中层 M6)。默认级别 info。
description: 按级别过滤的一行日志(中层 M6 + Mid2 M10 字段)。默认级别 info。
---
## 设级别
@@ -12,8 +12,9 @@ description: 按级别过滤的一行日志(中层 M6)。默认级别 info
## 调试
+ `内容`
+ `字段`=None
*line = > host_log_line level="debug" text=`内容`*
*line = > host_log_line level="debug" text=`内容` fields=`字段`*
1. `line`
> 打印 内容=`line`
2. *
@@ -21,8 +22,9 @@ description: 按级别过滤的一行日志(中层 M6)。默认级别 info
## 信息
+ `内容`
+ `字段`=None
*line = > host_log_line level="info" text=`内容`*
*line = > host_log_line level="info" text=`内容` fields=`字段`*
1. `line`
> 打印 内容=`line`
2. *
@@ -30,8 +32,9 @@ description: 按级别过滤的一行日志(中层 M6)。默认级别 info
## 警告
+ `内容`
+ `字段`=None
*line = > host_log_line level="warn" text=`内容`*
*line = > host_log_line level="warn" text=`内容` fields=`字段`*
1. `line`
> 打印 内容=`line`
2. *
@@ -39,8 +42,9 @@ description: 按级别过滤的一行日志(中层 M6)。默认级别 info
## 错误
+ `内容`
+ `字段`=None
*line = > host_log_line level="error" text=`内容`*
*line = > host_log_line level="error" text=`内容` fields=`字段`*
1. `line`
> 打印 内容=`line`
2. *
+21
View File
@@ -0,0 +1,21 @@
---
title: lib/统计
description: 薄均值 / 中位数 / 样本标准差(中层 Mid2 M10)。非数据框库。
---
## 均值
+ `列表`
**> host_stats_mean list=`列表`**
## 中位数
+ `列表`
**> host_stats_median list=`列表`**
## 标准差
+ `列表`
样本标准差;至少两个值。
**> host_stats_stdev list=`列表`**