...instead of hooking handlers onto multiple loggers with disabled propagation
from those loggers to parent loggers, breaking alternative log methods, like
custom setups through the the logging/config_file config value.
Fixes#661
Extension's setup method are now passed the active registry allowing them to
"steal" a list of the registry items they care about. In the case of commands
the registry is passed via args.registry.
This must be done early in the process life cycle to have any effect. In the
MPRIS frontend code is too late. Right before the GObject loop is created in
RootCommand.run() is also too late.
Fixesmopidy/mopidy-mpris#2
- Moves all startup code from start() into mopidy.commands
- Moves deps and config to mopidy.commands
- Plugs in use of commands parsing provided by new helpers
- Allows commands to override base verbosity level
- Removes defunct bootstrap logging helper.
- Bunch of typos and wording improvements from review.
- Fixed mopidy.backends.local.scan botched merge.
- Document and enforce that sub-command name needs to be bytes.
The delayed handler:
- Accepts and buffers logs until they are released.
- Upon release the logs are re-posted to the root logger.
- After release log records are ignored.
This allows us to avoid the silly tricks we've been doing with parsing args and
config early for the sake of bootstraping logging. Now we can just start
logging and once the logging has been setup the messages are released and
handled according to the correct settings.
- show-deps replaced with 'mopidy deps'
- show-config replaced with 'mopidy config'
- Just running mopidy now displays help, run 'mopidy run' to start server.
- Removes show_deps and show_config from commands module. These
are now handled directly in the main() method pending subcommands.
- Unifies show_config with general main() config handling.
- Sets default verbosity level to zero.
- Reduce verbosity when --show-config or --show-deps is called.
- Update console logging to consider verbosity < 0 quiet/
By separating the teardown procedures for errors that happens before and after
actors are started, we get a lot less output when failing on config errors.
This makes the config errors the last lines printed by the `mopidy` command,
making them easier to spot.
Related to #467
We already had code in place for this, but it was run after the config
validation, so on a new installation Mopidy would fail because of missing
config values before the config file was created.
It doesn't make sense to run Mopidy without extensions registered, thus you'll
need to use setuptools and to run `python setup.py develop` anyway. Doing so
makes running `mopidy` from anywhere in the development virtualenv work,
removing any need for running `python mopidy/`.