Skip to content
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

allow printing log messages during occ #873

Merged
merged 2 commits into from
Sep 18, 2023
Merged

allow printing log messages during occ #873

merged 2 commits into from
Sep 18, 2023

Conversation

icewind1991
Copy link
Member

@icewind1991 icewind1991 commented May 26, 2023

By setting OCC_LOG=<level> all log messages created while running the command will be printed to stderr.

@come-nc
Copy link
Contributor

come-nc commented Jun 12, 2023

Related to nextcloud/server#30989

@icewind1991 icewind1991 force-pushed the occ-log-printer branch 2 times, most recently from f058cdb to 675f339 Compare June 14, 2023 14:38
@icewind1991 icewind1991 force-pushed the occ-log-printer branch 6 times, most recently from f778fdf to 647fed2 Compare June 22, 2023 14:07
Copy link
Member

@blizzz blizzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with non-blocking comments

.github/workflows/phpunit-mysql.yml Outdated Show resolved Hide resolved

public function log(int $level, string $app, array $entry) {
if ($level >= $this->level) {
$messageWidth = $this->terminalWidth - 8 - 18 - 6;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

magic numbers (and in following lines are more magic numbers)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are the column widths that "seem to work best"

Same number as

$messageWidth = $totalWidth - 8 - 18 - 26 - 6;

Copy link
Member

@blizzz blizzz Jul 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better kept in named constants imo. Anyway, not blocking, up to you.

@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Patch coverage: 12.76% and project coverage change: -22.27% ⚠️

Comparison is base (d6d56b6) 42.26% compared to head (1cf6534) 20.00%.

Additional details and impacted files
@@              Coverage Diff              @@
##             master     #873       +/-   ##
=============================================
- Coverage     42.26%   20.00%   -22.27%     
- Complexity      139      159       +20     
=============================================
  Files            23       15        -8     
  Lines           601      480      -121     
  Branches         31        0       -31     
=============================================
- Hits            254       96      -158     
- Misses          347      384       +37     
Flag Coverage Δ
unit 20.00% <12.76%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
lib/AppInfo/Application.php 22.22% <0.00%> (+22.22%) ⬆️
lib/Log/Console.php 0.00% <0.00%> (ø)
lib/Listener/LogListener.php 46.15% <46.15%> (ø)

... and 11 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@icewind1991 icewind1991 merged commit fc17c6c into master Sep 18, 2023
22 of 26 checks passed
@icewind1991 icewind1991 deleted the occ-log-printer branch September 18, 2023 16:10
@icewind1991
Copy link
Member Author

/backport to stable27

@icewind1991
Copy link
Member Author

/backport to stable26

@backportbot-nextcloud
Copy link

The backport to stable27 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable27
git pull origin stable27

# Create the new backport branch
git checkout -b fix/foo-stable27

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable27

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@backportbot-nextcloud
Copy link

The backport to stable26 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable26
git pull origin stable26

# Create the new backport branch
git checkout -b fix/foo-stable26

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable26

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants