From mb at bese.it Tue Mar 2 09:48:15 2004 From: mb at bese.it (Marco Baringer) Date: Tue, 2 Mar 2004 10:48:15 +0100 Subject: [log4cl-devel] logging levels Message-ID: i was looking at the implementation of logging levels, i think it would be a better idea to assign each level a number this would be much faster than the current list based implementation, when we add or remove levels we can just update the numbers associated with each level. what do you think? -- Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen From lam at tuxfamily.org Tue Mar 2 17:21:45 2004 From: lam at tuxfamily.org (Lam) Date: Tue, 02 Mar 2004 18:21:45 +0100 Subject: [log4cl-devel] news Message-ID: i begin to create a web site for log4cl http://www.common-lisp.net/project/log4cl/ -- Nicolas Lamirault From lam at tuxfamily.org Tue Mar 9 18:03:53 2004 From: lam at tuxfamily.org (Lam) Date: Tue, 09 Mar 2004 19:03:53 +0100 Subject: [log4cl-devel] logging levels In-Reply-To: (Marco Baringer's message of "Tue, 2 Mar 2004 10:48:15 +0100") References: Message-ID: Marco Baringer writes: > i was looking at the implementation of logging levels, i think it > would be a better idea to assign each level a number this would be > much faster than the current list based implementation, when we add or > remove levels we can just update the numbers associated with each > level. what do you think? Currently levels are defined like this : (defparameter *levels* '(:debug :info :warning :error :fatal)) would you like to create a such structure like this : (defparameter *levels* '((:debug . 1) (:info . 2) (:warning . 3) (:error . 4) (:fatal . 5))) ? -- Nicolas Lamirault From nablaone at o2.pl Thu Mar 11 13:59:26 2004 From: nablaone at o2.pl (=?iso-8859-2?Q?Rafa=B3_Strzali=F1ski?=) Date: Thu, 11 Mar 2004 14:59:26 +0100 Subject: =?iso-8859-2?Q?Re:_[log4cl-devel]_logging_levels?= In-Reply-To: References: Message-ID: <20040311135926.26CC6630B8@rekin7.go2.pl> ---- Wiadomo?? Oryginalna ---- Od: Lam Do: log4cl-devel at common-lisp.net Data: Tue, 09 Mar 2004 19:03:53 +0100 Temat: Re: [log4cl-devel] logging levels >Marco Baringer writes: > >> i was looking at the implementation of logging levels, i think it >> would be a better idea to assign each level a number this would be >> much faster than the current list based implementation, when we add or >> remove levels we can just update the numbers associated with each >> level. what do you think? > >Currently levels are defined like this : > >(defparameter *levels* '(:debug :info :warning :error :fatal)) > >would you like to create a such structure like this : > >(defparameter *levels* > '((:debug . 1) > (:info . 2) > (:warning . 3) > (:error . 4) > (:fatal . 5))) > I prefer using symbol properties to things like that. Example code (not tested): (defun update-level-symbols-properties () (let ((level 0)) (dolist (i *levels*) (setf (get i 'log4cl-level) (incf level))))) (defun level> (a b) (> (get a 'log4cl-level) (get b 'log4cl-level)) -- Pozdrawiam, Rafal Strzalinski (nabla) http://nabla.prv.pl