On Tuesday, August 9, 2016, Volker Braun <vbraun.n...@gmail.com> wrote:

> The only good way is to rip out the "verbose" thing and replace it with
> the Python logging module. Then its easy to have different loggers for your
> code and for the flint interface, and make them log in different levels
> and/or different output streams.
>
>
You don't have rip out verbose and replace it.  Just switch to using
the built in Python logging module for what you're doing.   We should also
reimplement verbose on top of pythons built in logging module (probably
just a few lines of code to do that).  I'm very surprised nobody has done
this already.


>
>
>
> On Tuesday, August 9, 2016 at 11:42:32 AM UTC+2, Daniel Krenn wrote:
>>
>> Say I have some function doing something:
>>
>> sage: def f(M):
>> ....:     A = M  # something will be done here
>> ....:     verbose('something', 1)
>> ....:     iA = A^(-1)
>> ....:     return iA
>>
>> Setting the level of verbosity to 1 gives the output
>>
>> sage: set_verbose(1)
>> sage: f(Matrix([[1, 2], [3, 4]]))
>> verbose 1 (f) something (time = -0.092)
>> verbose 1 (f) computing inverse of 2 x 2 matrix using FLINT
>> [  -2    1]
>> [ 3/2 -1/2]
>>
>> How to repress the second verbose ("inverse...FLINT")?
>>
>> Ideally there would be something that increases all verbosity levels of
>> the functions I call within f, so that the messages are still there when
>> calling f with level >= 2, but leaves level 1 for my high-level function.
>>
>> Any ideas how to accomplish this (in a good way)?
>>
>> Best
>>
>> Daniel
>>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','sage-devel%2bunsubscr...@googlegroups.com');>
> .
> To post to this group, send email to sage-devel@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','sage-devel@googlegroups.com');>.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Sent from my massive iPhone 6 plus.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to