Demonstrates Python logging module integration with dora's log capture system.
timer (10ms) --> send_data --> data --> receive_data_with_sleep (logging)
send_data (send_data.py) -- Sends 100 uint64 nanosecond timestamps on each timer tick.
receive_data_with_sleep (receive_data.py) -- Receives events and logs at multiple levels using Python's standard logging module:
node = Node()
log = logging.getLogger(__name__)
for event in node:
if event["type"] == "INPUT":
logging.info(f"info {event['value'].to_numpy()}")
log.log(logging.DEBUG, f"received {event['id']} with data")
log.warning("THIS IS A WARNING")
if event["type"] == "ERROR":
log.log(logging.ERROR, f"received {event} with data")Dora captures Python logging output automatically -- no special configuration needed. Use --log-level to filter:
dora run dataflow.yaml --log-level warn # only warnings and above
dora run dataflow.yaml --log-level debug # everythingdora run dataflow.yaml| Feature | Where |
|---|---|
logging.getLogger() integration |
Receiver |
| Multiple log levels (debug, info, warn, error) | Receiver |
--log-level CLI filtering |
CLI flag |
| Automatic stdout/stderr capture | Dora runtime |