Giter VIP home page Giter VIP logo

Comments (8)

stuarthodgson avatar stuarthodgson commented on May 15, 2024

This is interesting (relatively) the python method PyCallable_Check seems to think that the pointer passed in is NULL, at least that is what the debug looks like when matched up to the C source of the method. Revisit later.

from cocotb.

stuarthodgson avatar stuarthodgson commented on May 15, 2024

After some more looking at this it seems to be that the filter object is returning false and so not outputting anything to log.

from cocotb.

chiggs avatar chiggs commented on May 15, 2024

We should filter out the DEBUG messages that appear as cocotb starts up since they are generally meaningless to users.

We probably just want one INFO message to indicate that the Python interpreter has started successfully.

from cocotb.

GordonMcGregor avatar GordonMcGregor commented on May 15, 2024

How is logging enabled/ disabled? (Didn't find it in the documentation ;) )

from cocotb.

chiggs avatar chiggs commented on May 15, 2024

-DFILTER in lib/gpi/Makefile filters any debug log messages from the C world.

In Python it's all using the standard logging library so you can do something like this:

dut.log.setLevel(logging.ERROR)
cocotb.scheduler.log.setLevel(logging.DEBUG)

from cocotb.

GordonMcGregor avatar GordonMcGregor commented on May 15, 2024

Just trying to clarify some things:

The LOG_WARN etc macros in the library use gpi_log to send log messages to the Python handler, with the module name cocotb.gpi

How do I control the level of filtering on those messages from Python -assuming -DFILTER is defined?

from cocotb.

stuarthodgson avatar stuarthodgson commented on May 15, 2024

The logging is controlled by LOG_ however there is a bug at the moment in the filter inside gpi_log, currently wrapped with FILTER. The problem being that no matter what the filter level the python object we call always rejects message and so nothing is printed. The current code is a work around such that you can have logging from the C world but it is all or nothing and a compilation time option.

see bug #12

from cocotb.

GordonMcGregor avatar GordonMcGregor commented on May 15, 2024

ok - that matches the behaviour I was seeing.

Gordon

On Thu, Jul 11, 2013 at 4:17 AM, stuarthodgson [email protected]:

The logging is controlled by LOG_ however there is a bug at the moment in
the filter inside gpi_log, currently wrapped with FILTER. The problem being
that no matter what the filter level the python object we call always
rejects message and so nothing is printed. The current code is a work
around such that you can have logging from the C world but it is all or
nothing and a compilation time option.

see bug #12 #12


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-20799388
.

from cocotb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.