silverstripe-crontask icon indicating copy to clipboard operation
silverstripe-crontask copied to clipboard

Add LoggerInterface argument to process.

Open sminnee opened this issue 9 years ago • 3 comments

It would be nice if the process() method could be passed a Psr\Log\LoggerInterface object for it to send it status output to.

That way, process implementors can provide a range of output at debug, info, and notice level and the logger can decide what to do.

Coupled to this, I would suggest that the dev/cron action has a suitable logger injected into it, and perhaps defaults to a logger that dumps notice-and-above level errors to stdout. Making monolog a composer dependency might be the easiest solution for that. (Requiring monolog ~1.11 will ensure that you get a PSR-3 complaint version).

This would need to be a major version bump of the crontask module as it would change its interface.

sminnee avatar Aug 17 '15 21:08 sminnee

It would probably make sense to bundle this in with the any SS4 compact changes still to be made and released

robbieaverill avatar Dec 24 '16 07:12 robbieaverill

@sminnee do you think we should do this before tagging 2.0.0 stable (SS4 compatible)?

robbieaverill avatar Dec 13 '17 05:12 robbieaverill

@sminnee do you think we should do this before tagging 2.0.0 stable (SS4 compatible)?

please :)

dhensby avatar Dec 13 '17 15:12 dhensby

Interesting idea but it's an old issue that we're not going to do anything with any time soon. Closing. If someone is keen for this and wants to put in the work to implement it, @ me and we can revisit.

GuySartorelli avatar Sep 08 '23 01:09 GuySartorelli