1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
5 ;;;; Name: console.lisp
6 ;;;; Purpose: Console interactiion
7 ;;;; Programmer: Kevin M. Rosenberg
8 ;;;; Date Started: Dec 2002
12 ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
13 ;;;; and by onShore Development, Inc.
15 ;;;; KMRCL users are granted the rights to distribute and use this software
16 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
17 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
18 ;;;; *************************************************************************
22 (defvar *console-msgs* t)
24 (defvar *console-msgs-types* nil)
26 (defun cmsg (template &rest args)
27 "Format output to console"
29 (setq template (concatenate 'string "~&;; " template "~%"))
30 (apply #'format t template args)))
32 (defun cmsg-c (condition template &rest args)
33 "Push CONDITION keywords into *console-msgs-types* to print console msgs
34 for that CONDITION. TEMPLATE and ARGS function identically to
35 (format t TEMPLATE ARGS) "
36 (when (or (member :verbose *console-msgs-types*)
37 (member condition *console-msgs-types*))
38 (apply #'cmsg template args)))
40 (defun cmsg-add (condition)
41 (pushnew condition *console-msgs-types*))
43 (defun cmsg-remove (condition)
44 (setf *console-msgs-types* (remove condition *console-msgs-types*)))
46 (defun fixme (template &rest args)
47 "Format output to console"
48 (setq template (concatenate 'string "~&;; ** FIXME ** " template "~%"))
49 (apply #'format t template args)