diff options
| author | Konstantin Kirik (snegovick) <snegovick@uprojects.org> | 2025-12-25 17:09:35 +0300 |
|---|---|---|
| committer | Konstantin Kirik (snegovick) <snegovick@uprojects.org> | 2025-12-25 17:09:35 +0300 |
| commit | 55dba26bfd2c49bbd07e4da95179a53ce5c163a8 (patch) | |
| tree | 62dfce9508679026461b9c21e281b9b0ba8841c0 /module/sh9log.m | |
| parent | 2630491c9870e71a78791a8144a340e4cd5f99ed (diff) | |
Add logger to control debug printing from single point
Diffstat (limited to 'module/sh9log.m')
| -rw-r--r-- | module/sh9log.m | 22 |
1 files changed, 22 insertions, 0 deletions
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(); +}; |
