[log5-devel] Dynamically set log level

Gary King gwking at metabang.com
Tue Aug 28 00:31:54 UTC 2007


Hi Stefan,

> I'm curious if it is possible to dynamically set the log level when
> creating a sender like:
>
> (defun init-logging (log-level)
>   (log5:defoutput human-time (human-time))
>   (log5:start-sender *my-logger*
> 		     (log5:stream-sender :location *standard-output*)
> 		     :category-spec log-level
> 		     :output-spec (log5:category human-time log5:message  
> log5:context)))

Other than moving the defoutput from inside the defun to outside it  
(for efficiency reasons), I think that what you have there is exactly  
right.

> I know, that it does not work like that, but is there another way than
> using configure-from-file?

Both the start-sender macro and configure-from-file call the start- 
sender-fn so your definition ought to work. What happens when you try  
it?

> Thanks in advanced for your help.

My pleasure.
--
Gary Warren King, metabang.com
Cell: (413) 559 8738
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM







More information about the Log5-devel mailing list