Skip to main content

DGTL Health BV NEN7513 compliant logging objects

Project description

dgtl-logging

NEN7513 compliant logging library according to the current scope of DGTL Health BV

Updating

  • update setup.py with new version number
  • push or merge pull request to master branch and a github action will build and publish the package

Installing

pip install dgtl-logging

Usage

EventObject, UserObject and CustomObject

Usage of the EventObject and UserObject are similar and have a validate() method built-in. The CustomObject does not have predefined parameters.

Use the validate() method just before passing the object to your logging function.

from dgtl_logging.dgtl_logging import CustomObject, EventObject, UserObject

event = EventObject()
event.update_parameters(gebeurteniscode='code1')
event.update_parameters(actiecode='action1', utcisodatetime='2023-10-10T00:00:00Z')
event.update_parameters(identificatortype='type1', identificator='id1', aard='typeA')

To validate if all required parameters are filled: event.validate()

Writing to the logging ledger

DGTLLogging can be initiated as follows dgtl_logging = DGTLLogging(log_ledger_table=log_ledger_table, env='test'). Where log_ledger_table is the logging table in the chosen ledger. env is the environment (i.e. dev, acc, prod, etc.).

When all required parameters are added to the EventObject and UserObject you can pass them to resp = dgtl_logging.add_log(event_object=event, user_object=user), which returns True when the insertion was succesful and raises an error otherwise.

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

dgtl_logging-0.0.11.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

dgtl_logging-0.0.11-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file dgtl_logging-0.0.11.tar.gz.

File metadata

  • Download URL: dgtl_logging-0.0.11.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for dgtl_logging-0.0.11.tar.gz
Algorithm Hash digest
SHA256 c5a7f72eedb3e59096031f12a006980b3ff29ebcce5f6f8fda89341754b4aff9
MD5 8c792107048dbdc5deb501c8579400a6
BLAKE2b-256 80587ff6f79a020c49d72681a2d11e2998d59459861f6c6410c8419195c17a2a

See more details on using hashes here.

File details

Details for the file dgtl_logging-0.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for dgtl_logging-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 a615840deb9909775e61313f631d7d77ae2e021b9a49064c36ddceebb324656a
MD5 be00fe264f6bc5c0be5c0d91f52e55d9
BLAKE2b-256 15ec9849ea3f079aac6eb29b58edd8d10b2096a6461b06d6f1b699e0e2a863ad

See more details on using hashes here.

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