diff options
author | Jonathan Marshall <jmarshall@xbmc.org> | 2014-06-13 08:39:07 +1200 |
---|---|---|
committer | Jonathan Marshall <jmarshall@xbmc.org> | 2014-06-13 08:43:51 +1200 |
commit | 0f42b7a16b6b09772c365c41f99d0d92b8a8e27d (patch) | |
tree | 3e4d33638aa8cad1417a9bf7a95d205dc6df2091 | |
parent | 192223b792114dc117057b04080f675dda2ddd23 (diff) |
[logging] improve logging/messages where network isn't available. fixes #15290, #15291
-rw-r--r-- | xbmc/filesystem/DirectoryFactory.cpp | 5 | ||||
-rw-r--r-- | xbmc/utils/RssReader.cpp | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/xbmc/filesystem/DirectoryFactory.cpp b/xbmc/filesystem/DirectoryFactory.cpp index 3f56c7d809..e0761c9e55 100644 --- a/xbmc/filesystem/DirectoryFactory.cpp +++ b/xbmc/filesystem/DirectoryFactory.cpp @@ -186,7 +186,8 @@ IDirectory* CDirectoryFactory::Create(const CURL& url) if (strProtocol == "androidapp") return new CAndroidAppDirectory(); #endif - if( g_application.getNetwork().IsAvailable(true) ) // true to wait for the network (if possible) + bool networkAvailable = g_application.getNetwork().IsAvailable(true); // true to wait for the network (if possible) + if (networkAvailable) { if (strProtocol == "tuxbox") return new CTuxBoxDirectory(); if (strProtocol == "ftp" || strProtocol == "ftps") return new CFTPDirectory(); @@ -244,7 +245,7 @@ IDirectory* CDirectoryFactory::Create(const CURL& url) #endif } - CLog::Log(LOGWARNING, "%s - Unsupported protocol(%s) in %s", __FUNCTION__, strProtocol.c_str(), url.Get().c_str() ); + CLog::Log(LOGWARNING, "%s - %sunsupported protocol(%s) in %s", __FUNCTION__, networkAvailable ? "" : "Network down or ", strProtocol.c_str(), url.GetRedacted().c_str() ); return NULL; } diff --git a/xbmc/utils/RssReader.cpp b/xbmc/utils/RssReader.cpp index 12bbeb5e39..e9a2f6f50e 100644 --- a/xbmc/utils/RssReader.cpp +++ b/xbmc/utils/RssReader.cpp @@ -147,7 +147,10 @@ void CRssReader::Process() // we wait for the network to come up if ((url.GetProtocol() == "http" || url.GetProtocol() == "https") && !g_application.getNetwork().IsAvailable(true)) + { + CLog::Log(LOGWARNING, "RSS: No network connection"); strXML = "<rss><item><title>"+g_localizeStrings.Get(15301)+"</title></item></rss>"; + } else { XbmcThreads::EndTime timeout(15000); |