Skip to content

Commit a7de2a7

Browse files
authored
fix: Phase 0 - add private logging stub (no call-site changes)
Behavior-neutral: add private logging helper and level variables; no callers yet. Tests green.
1 parent 3573dd2 commit a7de2a7

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

enkan-repl.el

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,24 @@
9494
(defvar eat--process)
9595
(defvar eat-mode)
9696

97+
;;;; Logging (stub)
98+
99+
(defconst enkan-repl--log-levels '((error . 0) (warn . 1) (info . 2) (debug . 3))
100+
"Internal log level mapping for `enkan-repl--log'.")
101+
102+
(defvar enkan-repl--log-level 'error
103+
"Current internal log level for enkan-repl private logging.
104+
One of the symbols: `error', `warn', `info', or `debug'.")
105+
106+
(defun enkan-repl--log (level fmt &rest args)
107+
"Internal logging helper.
108+
LEVEL is one of `error', `warn', `info', or `debug'. Format FMT with ARGS
109+
and route via `message' only when LEVEL is enabled by `enkan-repl--log-level'."
110+
(when (let* ((lvl (cdr (assq level enkan-repl--log-levels)))
111+
(cur (cdr (assq enkan-repl--log-level enkan-repl--log-levels))))
112+
(and lvl cur (<= lvl cur)))
113+
(apply #'message fmt args)))
114+
97115
;;;; Custom Variables
98116

99117
(defgroup enkan-repl nil

0 commit comments

Comments
 (0)