skip to content
[readonly]

meshd's log: timestamped INFO/ERROR lines on stderr through a log thread that never blocks a caller, plus the last 1000 lines in memory

sh
$ sexc add @ajax/mesh-log
  • total 3
  • drwxr-xr-x-../
  • drwxr-xr-x-Oct 27 02:57v/# 1 version
  • drwxr-xr-x-Oct 27 02:57files/# the files of 0.1.0
latest
0.1.0, published Oct 27 02:57 by ajax
owners
ajax
license
MIT
dependencies
@ajax/mesh-text ^0.1.0, @ajax/mesh-check ^0.1.0
dependents
@ajax/mesh-control, @ajax/mesh-driver, @ajax/mesh-exec-wasm, @ajax/mesh-exec-wasm-testkit, @ajax/mesh-http-relay, @ajax/mesh-inferd, @ajax/mesh-jobd, @ajax/mesh-mps, @ajax/mesh-mps-worker, @ajax/mesh-native, @ajax/mesh-native-limits, @ajax/mesh-samplers, @ajax/mesh-shared, @ajax/meshd
keywords
mesh alphaos log stderr
homepage
https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-log
repository
https://github.com/thomasdavis/alpha-c-mesh
==> README.md <==
1# @ajax/mesh-log
2
3meshd's log: `mesh_info` / `mesh_error` lines with a UTC `HH:MM:SS.mmm` stamp, written to stderr by a log thread so no caller (the driver thread included) ever waits on stderr. A bounded queue of 4096 lines: when it is full the line is dropped and counted (`mesh_log_dropped`, the status block's S_LOG_DROPPED). The last 1000 lines are kept for meshd's `log` request. `mesh_log_exit` flushes for at most 500 ms.
4
5## Ported from
6
7[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): crates/mesh-host/src/log.rs.
8
9## Tests
10
11`tests/log.c`: the line format, the recent ring, and a reader-less pipe: emitting still returns at once and the drops are counted.
12
13## Licence
14
15MIT. See the repository's LICENSE.