loguru-dagster
loguru-dagster is a lightweight utility package that bridges Loguru with Dagster.
It enables colorized, contextual logging inside Dagster pipelines with a single decorator.
🚀 Installation
pip install loguru-dagster
This will automatically install the required loguru and dagster dependencies.
📦 Import Path
from loguru_dagster import dagster_context_sink, with_loguru_logger
🧪 Usage Example
- Loguru Direct Logging You can use Loguru directly inside a Dagster asset:
import dagster as dg
from loguru import logger
@dg.asset
def test_loguru_html_log():
"""Verify that all levels appear correctly in Dagster UI"""
logger.debug("==Debug== Loguru is working in Dagster!")
logger.info("==Info== Loguru is working in Dagster!")
logger.warning("==Warning== Loguru is working in Dagster!")
logger.error("==!!Error!!== Loguru is working in Dagster!")
return {"status": "done"}
defs = dg.Definitions(
assets=[test_loguru_html_log]
)
2.Bridge Loguru to context.log with Decorator To convert context.log calls into Loguru logs, use the decorator @with_loguru_logger from loguru_dagster:
import dagster as dg
from loguru_dagster import with_loguru_logger
@dg.asset
@with_loguru_logger
def my_contexlog_callig_loguru(context: dg.AssetExecutionContext) -> None:
context.log.debug("This is a context.log.debug message from my_contexlog_callig_loguru")
context.log.info("This is an context.log.info message from my_contexlog_callig_loguru")
context.log.warning("This is a context.log.warning message from my_contexlog_callig_loguru")
context.log.error("This is an context.log.error message from my_contexlog_callig_loguru")
context.log.critical("This is a context.log.critical message from my_contexlog_callig_loguru")
defs = dg.Definitions(
assets=[my_contexlog_callig_loguru]
)
🔗 Repository
Metadata
Release files for loguru-dagster 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| loguru_dagster-0.1.6.tar.gz | 12.3 kB | Without provenance | Details for loguru_dagster-0.1.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| loguru_dagster-0.1.6-py3-none-any.whl | Python 3 | none | any | Details for loguru_dagster-0.1.6-py3-none-any.whl |
Total release size: 26.2 kB
Release files / loguru_dagster-0.1.6.tar.gz
| Download URL | loguru_dagster-0.1.6.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ad3fb2a62f674869e48715d62fea80e2b0bf553cd8ecf38ba6d9cdf369a13ab
|
|
BLAKE2b-256 checksum How to use checksums |
6d1a439bf759728351025df7dd5bac33e478640a63f0c9b5cf82078b8d88f67e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.13
|
Release files / loguru_dagster-0.1.6-py3-none-any.whl
| Download URL | loguru_dagster-0.1.6-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47035530df69315db12f18b30f9eb291181d74888ef6c9512701f3a0ba5ee7df
|
|
BLAKE2b-256 checksum How to use checksums |
1b7be7f4d8aab4f08fabe9d1ac6e232ec02b9da8df2a6b38b9b1b1dbe398a864
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.13
|
Security for loguru-dagster 0.1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.