Skip to main content

Federated Data Logger

This project enables federated logging based on ZTL/ZMQ. It provides the zfl package on pypi.

Installation

Install zfl in your python virtual environment:

pip install zfl

Configuration

To use the logging service, the client needs a configuration file to specify how to reach the logging server. Refer to https://gitlab.com/robothouse/rh-projects/hospital-at-home/documentation/-/wikis/Reference-System for the hospital@home study setup. Here, we will use 147.197.166.151 as the host as it is currently configured as the test system in the lab.

Check the file ~/.config/zmq-remotes.yaml for federation endpoints. If you don't have this file, run the following command:

cat <<'EOF'>> ~/.config/zmq-remotes.yaml 
remotes:
  federation:
    host: "147.197.166.151"
    port: 5678
    scope: "/log"
publishers:
  federation:
    host: "147.197.166.151"
    port: 5778
    scope: "/log"
EOF

If you don't have access to an existing logging service, you can spawn your own server by running the service yourself. You need to adjust the above configuration file accordingly. Note that this example does not enable remote logging in the cloud, only local file logging and cache:

zfl_logging_service

Usage

Import SystemState from the zfl package and use it:

from zfl.logging.state import SystemState
state = SystemState()

To log your component's state, use update_state() with a dict. Use the cloud parameter to enable federated logging in the cloud:

state.update_state(
    {
        "my-component":
            {
                "example": 2,
                "state": "enabled"
            }
    },
    cloud = True)

To get the most recent state, use get_state():

curent_state = state.get_state()
print(current_state)

Check the example for an up-to-date usage example, including callback registration.

Metadata

Release files for zfl 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zfl 0.1.7
File Size Uploaded
zfl-0.1.7.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zfl 0.1.7
File Interpreter ABI Platform
zfl-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 19.0 kB

Release files / zfl-0.1.7.tar.gz

Download URL zfl-0.1.7.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4d93b326cdab0cf0427942126a52386cbc6b61091d77dba857c2ffc31dcd2675
BLAKE2b-256 checksum
How to use checksums
53427dadeb1e6480c9f1ea39207b3efe91e1ecfa4d02519750f190968b275a33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / zfl-0.1.7-py3-none-any.whl

Download URL zfl-0.1.7-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
090b91cd7e788fa93ec44190191210f358071c325f06a625f5fa35ef0c0a7439
BLAKE2b-256 checksum
How to use checksums
b4c00a276f91acfe2ad2a2938a492f9004c9b8f714a78dad7ca064301c6a19e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page