marqdo

17-stats-logok

features/17-stats-log.mq.md

Structure

importstats:lib/stats.mq.mdlog:lib/log.mq.md
fn · h1Closing Mid2 sugar
comment

Light statistics and optional fields= on log lines — no remote sinks, no dataframes.

fn · h1main
bind `xs` = [10, 20, 30]
bind `m` = > stats.mean list=`xs`
call> print text=`m`
bind `fld` = {step: done, status: ok}
call> log.info text=mid2-m10 fields=`fld`
Functions
Variables
  • fld map · 2
    stepdone
    statusok
  • m num
    20
  • xs list · 3
    #value
    110
    220
    330

Execution

20 INFO mid2-m10 step=done status=ok

Source

---
title: Mid stdlib — stats and log fields
description: Thin mean/median/stdev + structured log fields (Mid2 M10)
import stats:lib/stats.mq.md
import log:lib/log.mq.md
---

# Closing Mid2 sugar

Light statistics and optional `fields=` on log lines — no remote sinks, no dataframes.

# main

`xs` =

| |
|---|
| 10 |
| 20 |
| 30 |

**m = > stats.mean list=`xs`**
> print text=`m`

`fld` =

| step | status |
|------|--------|
| done | ok |

> log.info text="mid2-m10" fields=`fld`

Variable