Subject: [UFL-dev] Debug level messages

From: Anders Logg <[email-masked]>
Date: Fri, 6 Mar 2009 21:54:34 +0100

Is there any way to write debug messages on a level other than 0
(using info) or 1 (using debug)?

-- 
Anders

---

From: Martin Sandve Alnæs <[email-masked]>
Date: Sat, 7 Mar 2009 12:08:57 +0100

l = ufl.log.ufl_logger.get_logger()
l.log((logging.INFO + logging.DEBUG)/2, "message")

Martin

2009/3/6 Anders Logg <[email-masked]>:
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkmxjYoACgkQTuwUCDsYZdEu+QCfYvOvQDKs2VJaV/GQy8rRtZgK
> ZP4An11hJ1Rgba/MakLVLvLUgI344Zws
> =5eDk
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> UFL-dev mailing list
> [email-masked]
> http://fenics.org/mailman/listinfo/ufl-dev
>
>

---

From: Martin Sandve Alnæs <[email-masked]>
Date: Sat, 7 Mar 2009 12:51:41 +0100

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

---

From: Anders Logg <[email-masked]>
Date: Sat, 7 Mar 2009 19:45:42 +0100

> FFC log, getting merged output from FFC and UFL.

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.

-- 
Anders

---

From: Martin Sandve Alnæs <[email-masked]>
Date: Sun, 8 Mar 2009 10:23:32 +0100

>  debug("message", level=3)

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

---

From: Anders Logg <[email-masked]>
Date: Mon, 9 Mar 2009 08:25:49 +0100

> since there's a difference of 10 between

ok. I can probably manage with just one debug level.

-- 
Anders