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.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| zfl-0.2.0.tar.gz | 10.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zfl-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.6 kB
Release files / zfl-0.2.0.tar.gz
| Download URL | zfl-0.2.0.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e9fe65e20d33943241c93003c006334eacce6d09f250073a5e761145bc272684
|
|
BLAKE2b-256 checksum How to use checksums |
25878b17ac2def5e817b43a41bef080f02ec1c7d9b30dbdc26b2e33b7206786c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Release files / zfl-0.2.0-py3-none-any.whl
| Download URL | zfl-0.2.0-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3b390d8e844c5f0782e05b513be31994e0f22a2335e1369f86eae0262986133b
|
|
BLAKE2b-256 checksum How to use checksums |
fa3c126687b5e36775270580995f02366e9a9faf6409c8e01d031fc82dcd7c69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|