-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
--debug
bug maybe this will cause conflicts too easily. Changed to--debug-log
OC\Core\Command\Base
.--debug-log-level
when--debug-log
is usedChecklist