[Logging] Ensure logging is the last thing closed down

Otherwise crashes can occur if we log during GUPnP shutdown.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
[Logging] Added logging statements

The intention here is to log enough information during the execution
of commands and device discovery to identify the cause of any
crashes.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
[Logging] Be consistent with spacing when logging.

Newlines are now always inserted after MSU_LOG_ERROR to improve
readability.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
[Build] Fixed compilation error.

There is a compilation error when MSU_LOG_ERROR is enabled.  Forunately,
MSU_LOG_ERROR is currently broken and cannot be enabled so this compilation
error cannot currently be reproduced.  Best to fix it before fixing MSU_LOG_ERROR.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
[Logging] Fix MSU_LOG_ERROR

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
[Autotools] Change Silent rules default value

Silent rules default value set to true

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Autotools] Update log command line parameters

Add --with-log-type to specify log technology
Update --with-log to --with-log-level to avoid naming confusion

--with-log-type default value is 0 (=syslog) in release and
maintainer mode.

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Logging] Support new command line parameter

Support --with-log-type

Remove useless includes
Rename a function to be more accurate

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Logging] Remove global context parameter

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Settings] Add settings file to the build

Install media-service-upnp.conf in default system configuration
directory.

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Logging] Fix disabled macro definition

Remove old macro parameters (fmt, ...) -> (...)
Add braces to single if statement with logging macros

if (...)                  ->     if (...) {
    MSU_LOG_XXX                      MSU_LOG_XXX
                                 }

This is to prevent warnings/errors with empty body.

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Logging] Add a macro to display empty new line

Available only in debug, to make the flow of debug traces readable.

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Logging] Use new DEBUG NEW LINE macro

Remove custom debug code and use the new macro.

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Autotools] Fix array index

Fix an index potentially off limit.

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Settings] Manage settings file

- Manage settings files. Create a copy if it doesn't exist in
local folder and monitor change on this local file. When changes
occurs, reload settings from this local file.
If local file has been deleted, relead settings from system file.
If no settings file, fallback to compilation options.

- Manage logging settings.

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Logging] Use MSU_LOG_WARNING instead of MSU_LOG_ERROR

MSU_LOG_ERROR call assert() when using glib traces.

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Logging] Don't log messages too early

Don't log messages before reading settings files.

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Settings] Add default settings constants

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Settings] Add new api: msu_settings_is_never_quit

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
[Settings] Move settings data in context data

This will allow to access settings in the various glib
and gdus callbacks

Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>