← Back to team overview

ufl team mailing list archive

Re: Debug level messages

 

On Sat, Mar 7, 2009 at 7:45 PM, Anders Logg <logg@xxxxxxxxx> wrote:
> On Sat, Mar 07, 2009 at 12:51:41PM +0100, Martin Sandve Alnæs wrote:
>> Rather:
>>
>>   l = ufl.get_logger()
>>   level = (logging.INFO + logging.DEBUG)/2
>>   l.log(level, "message")
>>
>> You can also print to log files with different output
>> level than on screen, see recently added logtest.py.
>> You can even attach the same file handler to e.g. the
>> FFC log, getting merged output from FFC and UFL.
>>
>> Martin
>
> What I meant was is there an easy way to write debug messages from
> within UFL (or FFC) at a specific log level. Something like
>
>  debug("message", level=3)
>
> or similar.

No, but you can do the above.
We could make debug(..., level)
call log(logging.DEBUG+level, ...)
since there's a difference of 10 between
debug and info.

Martin


Follow ups

References