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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: dgtl_logging-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 c18079ee90d330d6e6534bea83f1631a160c3e7f1d063b4954db495149295f6f
MD5 935768e1d899d822bbdeac57161d3379
BLAKE2b-256 035978f2eb925fda2db4a65526ade764c717dbfce133194d9a11f0daf21e29e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dgtl_logging-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4766662bddecf13103351431ac5dfce89e8d028206de2aba3b8e8fff7c4e91e4
MD5 38a6ff915a1593cee89261ce0e7e7754
BLAKE2b-256 4627369c45bd4c159b96422b1b8749f32321b17efb9f2d8fb603f7f5906df0f9

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