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

Uploaded Source

Built Distribution

dgtl_logging-0.1.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dgtl_logging-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0cb9e553ea0f715596d24628b04dc0948355f32260fe5cedf42fbcccadac8ce4
MD5 348e9176f9d76ea62d97b3c46712a287
BLAKE2b-256 95cb99e15d7fca4b7abb90b5e188f30a8e75d7425e6663cdda1a656dc7f5b053

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dgtl_logging-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for dgtl_logging-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1b5b4f7c3e9c7fbb81438151de8c349e84064ef8bbd22fc3747a2d631b8a18b8
MD5 08f562b3d935c9ed263bf11b301773bf
BLAKE2b-256 0977a1690dfa82eb37915b6b17341f8570f4c05ab995f12782cd3cf3e8757186

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