OpenFn / kit

The bits & pieces that make OpenFn work. (diagrammer, cli, compiler, runtime, runtime manager, logger, etc.)
8 stars 12 forks source link

worker: support disabling all logs #655

Open josephjclark opened 2 months ago

josephjclark commented 2 months ago

We need to support a mode where all logging is disabled - logs don#t go to stdout and don't go to lightning.

Right now have a bunch of logging policies, I think they're called sanitisation policies? We proably just need to ensure there's one of those for "silent"

I don't think this is supported today

SatyamMattoo commented 1 month ago

Hello @josephjclark I have added the sanitization policy as proposed and it seems to be serving the purpose. I am a bit unsure about the approach, as I had another approach in mind where we could add a log function (warn, debug, success etc.) which might also serve the same purpose. I am unsure about these but hopefully you will guide me through. Best Regards

josephjclark commented 1 month ago

I've been thinking about this after @SatyamMattoo's PR. The original issue is slightly confused and I'll have to address it in the week.

In the meantime here are better notes:

The logger already supports a log=none mode which is used by the CLI.

Right now the worker always uses debug, so that all logs are returned and can be filtered by the user.

What we need is for the worker to support a logLevel option. This should be defaulted on startup and override by run options.

Later, Lightning can choose to set the log level to none whenever it wishes.