In testing the *first* hit on this does have `monitor.cmdr` set, but neither
`monitor.system` or `monitor.station`. So:
1. Allow those to be `None` in the function signature,
2. Guard against only `monitor.cmdr` being falsey before the call.
3. Move the `if err:` to the same scope.
* Renames `plug.notify_newdata()` to the more precise `notify_capidata()`.
* If CAPI data was from SERVER_LEGACY, then use plugin `cmdr_data_legacy()`
instead of `cmdr_data()`.
* A lot of this is commented out. It might be useful in the future, but
is just too noisy for now.
* Changed the protocol webserver to info, as it is.
* Left the EDSM 'not 1XX, 2XX or 5XX' in as it's a warning, so 'pass's
on the conditional bodies that would be empty now trace's are
commented.
* EDMCLogging.Logger.get_streamhandler() method to get the
logger_channel so prefs.py can call setLevel() on it.
* The top-level Logger level is always DEBUG.
* The RotatingFileHandler level is always DEBUG.
* The StreamHandler level is as configured by the user.
* EDMCLogging now creates a singleton of EDMCLogging.Logger and its
associated Logger.
* plug.py tweaked to only import EDMCLogging where it's needed for
getting/creating plugin loggers, else `import logging`.
1. This makes setting up logging everywhere slightly more involved.
2. If I then want to change, say, %(module)s value I'll end up needing
to stack walk again.
So this might be better done in a filter. But these commits for the
record, and to come back to if needs be.
* Log messages propagate up Parent.Child chains, so we don't need a
channel on the plugin logger.
* But it still needs the filter to define qualname and class for
formatting.
Using:
from EDMarketConnector import logger
causes issues if EDMarketConnector is already importing 'this' file.
So just get a logger using logger.getLogger(appname) instead.
`from config import appname` if needs be.
This relies on the logger.Formatter setup to fill in function name
rather than calling out exactly why we're logging. It should be
obvious, i.e. if you're in plug.py:notify_journal_entry then the named
plugin threw an un-caught exception trying to call its method for this.