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', raise_errors=True). Where log_ledger_table is the logging table in the chosen ledger. env is the environment (i.e. dev, acc, prod, etc.). raise_errors is useful for production workloads and uses logging.error() instead of raising an error and breaking any critical processes due to logging faults.

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.2.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

dgtl_logging-0.2.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dgtl_logging-0.2.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for dgtl_logging-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8bd40ef0a1754da1d3edfbf480b6bd5a4755370f361a55ea2d8956ac91f04342
MD5 4f50b75c20ace9260cb2d57ea3d7ee14
BLAKE2b-256 f2b2f54f36e8aea2e7bacedc5caf42d08d445d653333b5f14eb338bb0332a5ca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dgtl_logging-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for dgtl_logging-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73a3449495cef726ae96c7311755ee517a088a2d8a6e497fd30e8e024f9016be
MD5 e95b285756c42f392ea6762dc21e0624
BLAKE2b-256 f0b32e6c799638360ef49b6aa945c7b35b04261b1c5fec19d5217d78164edd99

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