From 55dba26bfd2c49bbd07e4da95179a53ce5c163a8 Mon Sep 17 00:00:00 2001 From: "Konstantin Kirik (snegovick)" Date: Thu, 25 Dec 2025 17:09:35 +0300 Subject: Add logger to control debug printing from single point --- module/sh9log.m | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 module/sh9log.m (limited to 'module/sh9log.m') diff --git a/module/sh9log.m b/module/sh9log.m new file mode 100644 index 0000000..4ed5929 --- /dev/null +++ b/module/sh9log.m @@ -0,0 +1,22 @@ +Sh9Log: module +{ +PATH: con "/dis/lib/sh9log.dis"; +DESCR: con "Log functions for sh9"; + +LOG_DBG, LOG_INF, LOG_WRN, LOG_ERR: con iota; + +Logger: adt +{ +outf: string; +level: int; +format: string; + +set_level: fn(m: self ref Logger, level: int); +dbg: fn(m: self ref Logger, s: string): int; +inf: fn(m: self ref Logger, s: string): int; +wrn: fn(m: self ref Logger, s: string): int; +err: fn(m: self ref Logger, s: string): int; +}; + +init: fn(); +}; -- cgit v1.2.3