datasette / datasette-enrichments

Tools for running enrichments against data stored in Datasette
https://enrichments.datasette.io
Apache License 2.0
16 stars 0 forks source link

Optional logging mechanism #26

Open simonw opened 7 months ago

simonw commented 7 months ago

Developing and debugging enrichments will be easier with a logging mechanism.

I'm already planning one of these specifically for errors:

But it strikes me that a _enrichment_logs table which is optionally used would be extremely handy too.

Maybe there's a checkbox for "enable debug logging" on the configure form? Or maybe it's a setting you have to turn on in plugin configuration settings. Or maybe it should default to having logs turned on unless you turn them off?

simonw commented 7 months ago

Table design:

create table if not exists _enrichment_logs (
    id integer primary key,
    job_id integer references _enrichment_jobs(id),
    message text,
    created_at text
)
simonw commented 7 months ago

Another way logging could work is that instead of being persisted to the database it could go to an in-memory storage of some sort, which could then be streamed to clients that want to see it.