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

Increase logging level for invalid config #1890

Merged
merged 3 commits into from Mar 20, 2020
Merged

Conversation

jjok
Copy link
Contributor

@jjok jjok commented Mar 17, 2020

Closes #1878

I added an unknownsection to my config and an unknownvalue to scrobbler to see how it looks. Turns out I already config set for 2 extensions that I don't have installed.

INFO     2020-03-17 23:08:11,518 [1:MainThread] mopidy.config
  Loading config from command line options
WARNING  2020-03-17 23:08:11,522 [1:MainThread] mopidy.config
  Ignoring config section 'local': A matching extension was not found
WARNING  2020-03-17 23:08:11,522 [1:MainThread] mopidy.config
  Ignoring config section 'soundcloud': A matching extension was not found
WARNING  2020-03-17 23:08:11,522 [1:MainThread] mopidy.config
  Ignoring config section 'unknownsection': A matching extension was not found
INFO     2020-03-17 23:08:12,261 [1:MainThread] mopidy.__main__
  Enabled extensions: gmusic, podcast, softwaremixer, mpd, http
INFO     2020-03-17 23:08:12,261 [1:MainThread] mopidy.__main__
  Disabled extensions: iris, spotify, stream, m3u, file, scrobbler
WARNING  2020-03-17 23:08:12,262 [1:MainThread] mopidy.__main__
  Found scrobbler configuration errors. The extension has been automatically disabled:
WARNING  2020-03-17 23:08:12,262 [1:MainThread] mopidy.__main__
    scrobbler/unknownvalue unknown config key.
WARNING  2020-03-17 23:08:12,262 [1:MainThread] mopidy.__main__
  Please fix the extension configuration errors or disable the extensions to silence these messages.

@codecov
Copy link

codecov bot commented Mar 17, 2020

Codecov Report

Merging #1890 into develop will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1890   +/-   ##
========================================
  Coverage    76.92%   76.92%           
========================================
  Files           55       55           
  Lines         4663     4663           
========================================
  Hits          3587     3587           
  Misses        1076     1076           

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 33ab10c...2f4335c. Read the comment docs.

@jodal jodal added this to the v3.0.2 milestone Mar 18, 2020
jodal
jodal approved these changes Mar 18, 2020
@kingosticks
Copy link
Member

kingosticks commented Mar 18, 2020

To be honest I don't think the message needed to change as the punctuation is odd now. But doesn't really matter. Although maybe the capital letter is from American English. Either way, who cares!

@jodal
Copy link
Member

jodal commented Mar 18, 2020

The text comes directly from my comment in the issue. Better if we replace : A with because a?

@kingosticks
Copy link
Member

kingosticks commented Mar 18, 2020

Ahh. Yes.

But wouldn't you also get this warning if you had a typo in a non-extension section name e.g. core.

@jjok
Copy link
Contributor Author

jjok commented Mar 18, 2020

But wouldn't you also get this warning if you had a typo in a non-extension section name e.g. core.

Ahh. That's not something that I tried. I'll give it a go.

@jjok
Copy link
Contributor Author

jjok commented Mar 18, 2020

Ahh. Yes.

But wouldn't you also get this warning if you had a typo in a non-extension section name e.g. core.

You get a fatal error if you have a typo in the main configuration.

[core]
unknown = value
WARNING  2020-03-18 18:35:13,989 [1:MainThread] mopidy.__main__
  Found fatal core configuration errors:
WARNING  2020-03-18 18:35:13,989 [1:MainThread] mopidy.__main__
    core/unknown unknown config key.
ERROR    2020-03-18 18:35:13,989 [1:MainThread] mopidy.__main__
  Please fix fatal configuration errors, exiting...

@kingosticks
Copy link
Member

kingosticks commented Mar 18, 2020

Excellent!

@jodal jodal merged commit 5c6348f into mopidy:develop Mar 20, 2020
2 of 3 checks passed
@jjok jjok deleted the fix/1878 branch Mar 20, 2020
AsbjornOlling pushed a commit to AsbjornOlling/mopidy that referenced this pull request Jun 12, 2021
* Increase logging level for invalid config

* Reformat with Black

* Tweak warning message for unknown config section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn on unrecognised config section
3 participants