amphp / parallel

An advanced parallelization library for PHP, enabling efficient multitasking, optimizing resource use, and application responsiveness through multiple CPU threads.
MIT License
781 stars 64 forks source link

Logging #50

Open theofidry opened 6 years ago

theofidry commented 6 years ago

It's worth mentioning I'm mostly using parallelMap rather than parallel directly and this may be purely a doc issue.

My main "complain" and by that I mean pain to check, monitor or debug what's going on when using Amp is that there is absolutely nothing to see. I see a list of workers with their CPU usages, and that's it. There is no logs about how many workers, which command is used to start them, what is their workload or status.

Did I miss something or this is completely missing? If so it would be really interesting to investigate how this could be done. I really like for example how XdebugHandler does it: just plug your logger there and you have everything you need

kelunik commented 6 years ago

@theofidry Logging is currently left to the user. We have some support for logging in amphp/cluster, which is still in an rather early phase.

Do you want logging from the child to the parent or logging within amphp/parallel to see what's going on in the library itself?

theofidry commented 6 years ago

On top of my head a non exhaustive thing I wish I could see:

So mostly stuff from the parent although this includes the status about the children

theofidry commented 5 years ago

A random thought about this: how about making use of a logger class? I mean the basic PSR3 one which would allow the users to pass their own logger with whatever verbosity they wish. The logger could be made optional and make use of the NullLogger when none is passed. WDYT?