viva_glyph/log

VIVA Glyph Logging - Structured logging for emotional processing

Usage

import viva_glyph/log

// Initialize once at startup
log.configure()

// Log operations
log.encode("PAD→Glyph", "p=0.7 a=0.3 d=0.5 → [142,87,23,201]")
log.learn("ctx=7 glyph=[142,87,23,201] strength=0.42")
log.warn("round_trip", "error=0.15 > threshold")

Log Levels

Values

pub fn configure() -> Nil

Initialize logging with pretty Gleam output Call once at application startup

pub fn debug(tag: String, msg: String) -> Nil

Debug level log

pub fn decode(details: String) -> Nil

Log decode operation

pub fn disable_debug() -> Nil

Disable debug logging (Info and above only)

pub fn enable_debug() -> Nil

Enable debug logging

pub fn encode(details: String) -> Nil

Log encode operation

pub fn error(tag: String, msg: String) -> Nil

Error level log

pub fn fmt_assoc(
  ctx: Int,
  strength: Float,
  fire_count: Int,
) -> String

Format association

pub fn fmt_float(f: Float) -> String

Format float with 4 decimal places

pub fn fmt_int(i: Int) -> String

Format int

pub fn fmt_pad(p: Float, a: Float, d: Float) -> String

Format PAD state

pub fn fmt_tokens(tokens: List(Int)) -> String

Format list of ints (glyph tokens)

pub fn inference(details: String) -> Nil

Log Active Inference metrics

pub fn info(tag: String, msg: String) -> Nil

Info level log

pub fn learn(details: String) -> Nil

Log learn (Hebbian) operation

pub fn numerical(details: String) -> Nil

Log numerical edge case

pub fn recall(details: String) -> Nil

Log recall operation

pub fn rvq(details: String) -> Nil

Log RVQ quantization

pub fn set_level(level: logging.LogLevel) -> Nil

Set minimum log level

pub fn tick(details: String) -> Nil

Log memory tick (decay)

pub fn warn(tag: String, msg: String) -> Nil

Warning level log

Search Document