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

use level config in log section when sub log section not set level #15176

Merged
merged 3 commits into from Mar 28, 2021

Conversation

a1012112796
Copy link
Member

@a1012112796 a1012112796 commented Mar 27, 2021

in previouse if a log subsetcion not set level
it will use info as default value.

this pr will make default value ([log] -> LEVEL) useable.

example config:

[log]
MODE = console
LEVEL = Trace

[log.console]
LEVEL =
STDERR = false

⚠️ BREAKING ⚠️

Prior to this change sub loggers would use the default logger level of INFO if not set - they will now inherit from the main logger.

Administrators should check their log configuration.

Screenshots

previous result:
p1

after:
p2

fix #15170

in previouse if a log subsetcion not set level
it will use ``info`` as default value.

this pr will make default value (``[log] -> LEVEL``) useable.

example config:
```INI
[log]
MODE = console
LEVEL = Trace

[log.console]
LEVEL =
STDERR = false
```

previous result:
```JSON
// console:
{
  "level": "info",
  ...................
}
```

after change:

```JSON
// console:
{
  "level": "track",
  ...................
}
```

Signed-off-by: a1012112796 <1012112796@qq.com>
@a1012112796
Copy link
Member Author

not confirm whether it's a bug fix or enhancement ....

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 27, 2021
@a1012112796 a1012112796 changed the title use level config in main section when subsection not set level use level config in log section when sub log section not set level Mar 27, 2021
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@6b836ac). Click here to learn what that means.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #15176   +/-   ##
=========================================
  Coverage          ?   43.54%           
=========================================
  Files             ?      668           
  Lines             ?    80600           
  Branches          ?        0           
=========================================
  Hits              ?    35098           
  Misses            ?    39794           
  Partials          ?     5708           
Impacted Files Coverage Δ
routers/install.go 0.00% <0.00%> (ø)
modules/setting/log.go 57.53% <100.00%> (ø)
modules/setting/setting.go 49.71% <100.00%> (ø)

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 6b836ac...b8e3d2f. Read the comment docs.

Copy link
Contributor

@zeripath zeripath left a comment

Choose a reason for hiding this comment

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

it's probably a breaking change but definitely looks like an oversight on my behalf

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 27, 2021
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 27, 2021
@richmahn
Copy link
Contributor

LGTM as well.

@techknowlogick techknowlogick added this to the 1.15.0 milestone Mar 28, 2021
@zeripath zeripath merged commit 3273fb9 into go-gitea:master Mar 28, 2021
@6543 6543 added pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! type/enhancement An improvement of existing functionality labels Mar 28, 2021
@a1012112796 a1012112796 deleted the fix_log_default branch March 29, 2021 02:39
@go-gitea go-gitea locked and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Log level in subsection is not honored
8 participants