feat(occ): Add a --debug option to output all log levels to the output#46115
feat(occ): Add a --debug option to output all log levels to the output#46115
Conversation
2a3a1ab to
808a2d3
Compare
|
Hum, I think this is a duplicate of nextcloud/logreader#873 . |
Makes sense.
Maybe
We can do both by allowing something like
Allowing a log level and defaulting to debug makes most sense to me (
Should be a separate options
Also would have that as a separate option. -- It might make sense to have this logic detect if the logreader is available and delegate the logging to the logreader when possible, since that app already has cli log formatting. Keeping a "basic" log output in core. |
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
…n for level Also changed option from --debug to --debug-log to avoid conflicts Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
808a2d3 to
9baf8fe
Compare
| $argv = $_SERVER['argv']; | ||
| $level = 0; | ||
| foreach ($argv as $key => $arg) { | ||
| if ($arg === '--debug-log') { |
There was a problem hiding this comment.
Should we put them into OCP somewhere so app devs have a list/track of "reserved arguments"?
…ow about them Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1ac84bf to
612088b
Compare
…ption Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
| /** | ||
| * @since 30.0.0 | ||
| */ | ||
| final class ReservedOptions { |
There was a problem hiding this comment.
Related to #30989
Summary
Adds a universal option to pass to occ commands so that all levels of logs are printed in the output, even if the loglevel on the instance is higher.
This allows to inspect all the logging related to a command without having it mixed up with logs from other stuff going on in the server. Also allows to have logs and command output in the same place to see in which order things happen.
This is especially useful with user_ldap as all LDAP calls are logged in debug level.
TODO
--debugbug maybe this will cause conflicts too easily. Changed to--debug-logOC\Core\Command\Base.--debug-log-levelwhen--debug-logis usedChecklist