We have some long running processes which could run for as long as an hour up to 6 hours.
Some of the processes are started by hand and the user wants to see what the progress of the process is.
Without getting into to much details of the actual details, you could think of:
- Fetching data
- Update client info
- remove false data
- create external files
- create pdf
This process of course consists of loads of different classes, and sometimes I want those individual classes to write progress.
For example: When I am only interested in high overview progress, I could write the progress from the top level facade, but I also want to write progress in the service which creates the pdf's, so that class and it's subclasses also have to write progress.
My question is: how can I write progress from all those classes regarding the same 'base' process without passing some kind of processid from class to class?
What I thought of is creating a loggingservice class which takes care of the logging and passing that from class to class, but that seems so nasty to hand every single class the logging service.
Second I thought of is to create a static loggingservice class for the logging (which I find common in applications for the normal error logging) but then I still have to pass the processId around
Third I thought of creating a factory to be called from every class, but then I still have to pass the processId around
Fourth I thought of injecting the loggingservice class in every class, but then I still have to pass the processId around and it seems like a wrong kind of dependency for a class to have, a dependency for a logger.
So I am looking for either number 5, or reasons why 1,2,3 or 4 is a good idea anyway and the downsides I see are not relevant or important.