feat(v4.0.0): logging, as v3

- capsule/log.v4: the level constants LOG-ERROR .. LOG-DEBUG, LOG-LEVEL!
  and LOG-LEVEL@, LOG-ERROR" .. LOG-DEBUG" and LOG-ERROR-STR ..
  LOG-DEBUG-STR.  A message is printed if its level is at or below
  LOG-LEVEL, as v3's line -- colour, level, text -- without the time of
  day, which a node has not got.
- LOG-xxx" compiles like ." : the level, a call to (LOG"), the text.  SEE
  shows it as text.  COLD puts LOG-LEVEL back to LOG-INFO.
- tests/test_host_quit.c: ten transcripts of the v3 binary, every level
  at every setting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rajames
2026-10-05 11:31:32 -04:00
co-authored by Claude Opus 5.5
parent 8c540b0305
commit 384a6c1cd2
6 changed files with 130 additions and 12 deletions
+2 -1
View File
@@ -46,7 +46,8 @@ VARIABLE (SN) \ how many lines
\ ( addr -- ) after a call to addr: if it is one of the words that are
\ followed by text, show the text and count its cells with the literals
: (TEXT?)
DUP ['] (.") = OVER ['] (ABORT") = OR SWAP ['] (S") = OR IF
DUP ['] (.") = OVER ['] (ABORT") = OR OVER ['] (LOG") = OR
SWAP ['] (S") = OR IF
(SP) @ (SLITS) @ + 4 * COUNT 34 EMIT 2DUP TYPE 34 EMIT SPACE
SWAP DROP 4 + 4 / (SLITS) +!
THEN ;