瀏覽代碼

Suppress unnecessary debug log entry due to default autoload feature.

Yao Wei Tjong 姚伟忠 9 年之前
父節點
當前提交
3a29bc2f3c
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      Source/Urho3D/Engine/Engine.cpp

+ 6 - 1
Source/Urho3D/Engine/Engine.cpp

@@ -331,7 +331,12 @@ bool Engine::Initialize(const VariantMap& parameters)
             }
             }
         }
         }
 
 
-        if (!autoLoadPathExist)
+        // The following debug message is confusing when user is not aware of the autoload feature
+        // Especially because the autoload feature is enabled by default without user intervention
+        // The following extra conditional check below is to suppress unnecessary debug log entry under such default situation
+        // The cleaner approach is to not enable the autoload by default, i.e. do not use 'Autoload' as default value for 'AutoloadPaths' engine parameter
+        // However, doing so will break the existing applications that rely on this
+        if (!autoLoadPathExist && (autoLoadPaths.Size() > 1 || autoLoadPaths[0] != "Autoload"))
             URHO3D_LOGDEBUGF(
             URHO3D_LOGDEBUGF(
                 "Skipped autoload path '%s' as it does not exist, check the documentation on how to set the 'resource prefix path'",
                 "Skipped autoload path '%s' as it does not exist, check the documentation on how to set the 'resource prefix path'",
                 autoLoadPaths[i].CString());
                 autoLoadPaths[i].CString());