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
- Debug: Internal details (RVQ stages, vector ops)
- Info: Normal operations (encode, decode, learn)
- Warning: Edge cases (high error, pruned memory)
- Error: Failures (numerical instability)
pub fn configure() -> Nil
Initialize logging with pretty Gleam output
Call once at application startup
pub fn debug(tag: String, msg: String) -> Nil
pub fn decode(details: String) -> Nil
pub fn disable_debug() -> Nil
Disable debug logging (Info and above only)
pub fn enable_debug() -> Nil
pub fn encode(details: String) -> Nil
pub fn error(tag: String, msg: String) -> Nil
pub fn fmt_assoc(
ctx: Int,
strength: Float,
fire_count: Int,
) -> String
pub fn fmt_float(f: Float) -> String
Format float with 4 decimal places
pub fn fmt_int(i: Int) -> String
pub fn fmt_pad(p: Float, a: Float, d: Float) -> String
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
pub fn learn(details: String) -> Nil
Log learn (Hebbian) operation
pub fn numerical(details: String) -> Nil
pub fn recall(details: String) -> Nil
pub fn rvq(details: String) -> Nil
pub fn tick(details: String) -> Nil
pub fn warn(tag: String, msg: String) -> Nil