ONSdigital / dp-data-pipelines

Pipeline specific python scripts and tooling for automated website data ingress.
MIT License
1 stars 0 forks source link

simple initial logging #105

Closed mikeAdamss closed 3 months ago

mikeAdamss commented 3 months ago

What is this

There have been two recent developers in the pipeline design.

Which means in order for the links we send to slack to have value, the pipeline code must have simple logging statments in them.

What to do

Add some standard python logging statments

Glue is set to capture logs of the INFO level and above as standard, so for our purposes here log to INFO.

As a rule:

Note: note the extras field to capture arbitrary information as key value pairs.

Verbose is fine, too much infomrmation is vastly preferable to too little as a starting point.

Once you are happy with the level of logging locally, ask mike to deploy your branch and we'll confirm it works as expected when ran on glue.

How to use the python logging library in this context:

import logging

# Note - for now, this will change,
logger = logging.getLogger(__name__)

# usage example
logger.info("Stuff, things, a message", extra={"some": "info", "some-other": "info"})

Acceptance Criteria

mikeAdamss commented 3 months ago

done