r3623: *** empty log message ***
[kmrcl.git] / console.lisp
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name:          console.lisp
6 ;;;; Purpose:       Console interactiion
7 ;;;; Programmer:    Kevin M. Rosenberg
8 ;;;; Date Started:  Dec 2002
9 ;;;;
10 ;;;; $Id: console.lisp,v 1.1 2002/12/13 21:59:57 kevin Exp $
11 ;;;;
12 ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
13 ;;;; and by onShore Development, Inc.
14 ;;;;
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 ;;;; *************************************************************************
19
20 (in-package :kmrcl)
21
22 (defvar *console-msgs* t)
23
24 (defvar *console-msgs-types* nil)
25
26 (defun cmsg (template &rest args)
27   "Format output to console"
28   (when *console-msgs*
29     (setq template (concatenate 'string "~&;; " template "~%"))
30     (apply #'format t template args))
31   (values))
32
33 (defun cmsg-c (condition template &rest args)
34   "Push CONDITION keywords into *console-msgs-types* to print console msgs
35    for that CONDITION.  TEMPLATE and ARGS function identically to
36    (format t TEMPLATE ARGS) "
37   (when (or (member :verbose *console-msgs-types*)
38             (member condition *console-msgs-types*))
39     (apply #'cmsg template args)))
40
41 (defun cmsg-add (condition)
42   (pushnew condition *console-msgs-types*))
43
44 (defun cmsg-remove (condition)
45   (setf *console-msgs-types* (remove condition *console-msgs-types*)))
46
47 (defun fixme (template &rest args)
48   "Format output to console"
49   (setq template (concatenate 'string "~&;; ** FIXME ** " template "~%"))
50   (apply #'format t template args)
51   (values))