Giter Site home page Giter Site logo

Comments (6)

flacjacket avatar flacjacket commented on July 27, 2024

Do you have any examples you are looking at? If something goes to stdout, we could capture that, but I'm not sure there is a great way to selectively capture logging messages going to stdout and pass through other things that are going to stdout.

from pywlroots.

flacjacket avatar flacjacket commented on July 27, 2024

If you are looking to capture wlroots's logging, does running wlroots.util.log.log_init solve your problem? That should setup the wlr logging to callback into log_func_callback for logging.

from pywlroots.

m-col avatar m-col commented on July 27, 2024

If I stick print("hi") within log_func_callback then I see a lot of lines printed to stdout, as expected. I think what's happened is I was expecting a similar signature between:

void wlr_log_init(enum wlr_log_importance verbosity, wlr_log_func_t callback);

and

def log_init(log_level: int) -> None

I guess the intended usage is to use an interface exposed by the logging module to change where the messages end up?

from pywlroots.

m-col avatar m-col commented on July 27, 2024

This does it:

import logging
from wlroots.util.log import logger, log_init

class PrintHandler(logging.Handler):
    def emit(self, record):
        print(record)

logger.addHandler(PrintHandler())
log_init(logging.DEBUG)

from pywlroots.

flacjacket avatar flacjacket commented on July 27, 2024

Nice! Does something like this do the trick, too?

import logging
from wlroots.util.log import log_init

logging.basicConfig(level=logging.DEBUG)
log_init(logging.DEBUG)

from pywlroots.

m-col avatar m-col commented on July 27, 2024

from pywlroots.

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.