[go: up one dir, main page]

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

fix(orm): txOrm miss debug log #4756

Merged
merged 6 commits into from
Sep 7, 2021
Merged

Conversation

a631807682
Copy link
Contributor

Close #4674

Copy link
Collaborator
@flycash flycash left a comment

Choose a reason for hiding this comment

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

I think this is not a good solution. We have dbQueryLog, and we will use it when DEBUG is true:
image

So as my understanding, when users use DEBUG=true, it should prints debug log.
And could you help to confirm that?

@a631807682
Copy link
Contributor Author

https://github.com/beego/beego/blob/develop/client/orm/orm.go#L536
@flycash Seems DoTx use new TxDB , so it lost query log when debug.

@flycash
Copy link
Collaborator
flycash commented Sep 2, 2021

how about update this?

	_txOrm := &txOrm{
		ormBase: ormBase{
			alias: o.alias,
			db:    newDbQueryLog(o.alias, tx),
		},
	}

@flycash
Copy link
Collaborator
flycash commented Sep 2, 2021

_txOrm := &txOrm{
ormBase: ormBase{
alias: o.alias,
db: newDbQueryLog(o.alias, &TxDB{tx:tx}),
},
}

@a631807682
Copy link
Contributor Author

_txOrm := &txOrm{
ormBase: ormBase{
alias: o.alias,
db: newDbQueryLog(o.alias, &TxDB{tx:tx}),
},
}

we can't do this, dbQuerier print debug log although Debug flag is false, i create a test for it.

9b14501#diff-c3b3b1de3f657359cafc028e17ae972b7e2e1a5965fe23e02d89d2cac8e021c7R2916

@flycash
Copy link
Collaborator
flycash commented Sep 3, 2021

nice, please resolve the conflicts and rebase your PR to one commit id

@codecov-commenter
Copy link
codecov-commenter commented Sep 3, 2021

Codecov Report

Merging #4756 (b1fbaa7) into develop (556e743) will increase coverage by 0.16%.
The diff coverage is 93.93%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4756      +/-   ##
===========================================
+ Coverage    54.49%   54.66%   +0.16%     
===========================================
  Files          243      243              
  Lines        21723    21734      +11     
===========================================
+ Hits         11839    11881      +42     
+ Misses        8935     8903      -32     
- Partials       949      950       +1     
Impacted Files Coverage Δ
client/orm/orm.go 79.80% <93.54%> (+6.71%) ⬆️
client/orm/filter_orm_decorator.go 86.94% <100.00%> (ø)
core/logs/file.go 67.27% <0.00%> (-3.64%) ⬇️
client/orm/db_alias.go 65.23% <0.00%> (-0.72%) ⬇️
client/orm/db.go 81.81% <0.00%> (+0.07%) ⬆️
task/task.go 68.81% <0.00%> (+0.80%) ⬆️
client/orm/orm_log.go 86.84% <0.00%> (+16.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 556e743...b1fbaa7. Read the comment docs.

@flycash
Copy link
Collaborator
flycash commented Sep 3, 2021

Please fix the golint issues(you can find them in Files Changed) and DeepSource issues (click detail and you can find it`.

Most of them were introduced by original developer, but I think you can help to fix them

@a631807682
Copy link
Contributor Author

I will fix it later

@sonarcloud
Copy link
sonarcloud bot commented Sep 7, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@a631807682
Copy link
Contributor Author
a631807682 commented Sep 7, 2021

getMiInd is split into getMi and getPtrMiInd func by DeepSource issues, i'm not sure if it is the best way. I will rebase all commit after review.

@flycash
Copy link
Collaborator
flycash commented Sep 7, 2021

getMiInd is split into getMi and getPtrMiInd func by DeepSource issues, i'm not sure if it is the best way. I will rebase all commit after review.

It looks good. Thank you very much.

@flycash flycash merged commit d01f2dd into beego:develop Sep 7, 2021
@a631807682 a631807682 deleted the fix/issue4674 branch September 7, 2021 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants