The option was declared in Application::getDefaultInputDefinition but
never consumed, so a user passing --log foo.log saw the option in --help
yet no file was ever written (see phpDocumentor#1872).
Wire a LogConfigurator event listener that, on ConsoleEvents::COMMAND,
pushes a Monolog StreamHandler for the requested path. The handler
level follows the console verbosity (notice, -v info, -vv/-vvv debug)
and --quiet disables file logging entirely, matching the intent
captured in Transform.php. Paths are canonicalised through Monolog
Utils so a relative and an absolute form dedup to the same handler on
nested ConsoleEvents::COMMAND dispatches, and the same dedup is applied
to the ConsoleLogHandler to avoid duplicate console output.
Covered by new unit tests for missing / empty / quiet cases, the
verbosity-to-level mapping, the nested-dispatch and relative-path
dedups, and distinct log files producing two handlers. A functional
test runs phpdoc with --log and asserts the target receives a stable
log line.
Fixes phpDocumentor#1872
Wire up the --log CLI option so it actually creates the requested log file.
The option was declared in Application::getDefaultInputDefinition() but never consumed: no Monolog handler was attached, so the file was never created (see #1872).
This change:
The v2 <logging> XML node only accepts <level> and never had a <paths> child; the v3 config schema has no logging node at all. Fixing that XML path is out of scope for this PR.
Fixes #1872.