Skip to main content

Bridge Python and GLib logging facilities

Project description

Python ↔ GLib logger bridge

This library allows you to redirect either from the python logger facility to the glib logging facility, or the other way around.

NOTE: THIS IS STILL IN DEVELOPMENT! IT MIGHT NOT WORK CORRECTLY, AND THE INTERFACE CAN CHANGE!

Quick Usage

GLib → Python

from gi.repository import GLib
import glib_log_bridge.glib2python as glib2python
g2plog = glib2python.GLibToPythonLogger()
GLib.log_set_writer_func(g2plog.glibToPythonLogWriterFunc, None)

Python → GLib

import logging
import glib_log_bridge.python2glib as python2glib
handler = python2glib.PythonToGLibLoggerHandler()
logging.getLogger().addHandler(handler)
# Logger to apply, logger.getLogger() does it for all messages

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glib-log-bridge-0.0.1.tar.gz (10.7 kB view hashes)

Uploaded Source

Built Distribution

glib_log_bridge-0.0.1-py3-none-any.whl (12.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page