summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-08-24 08:47:34 +0200
committerRémi Verschelde <rverschelde@gmail.com>2018-08-24 09:23:20 +0200
commitde59fe04e73250229e6ac11f9314e1b75dbdef1a (patch)
treefa99f0927da10719fb7a7e1e8fcce3a97d5fe08c /core/io
parent34e58fd831172bad1eebb748c97238c28864423a (diff)
Add print_verbose to print to stdout only in verbose mode
Equivalent of the cumbersome: if (OS::get_singleton()->is_stdout_verbose()) print_line(msg);
Diffstat (limited to 'core/io')
-rw-r--r--core/io/resource_loader.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp
index 8b0655deb0..c01aff9144 100644
--- a/core/io/resource_loader.cpp
+++ b/core/io/resource_loader.cpp
@@ -204,8 +204,7 @@ RES ResourceLoader::load(const String &p_path, const String &p_type_hint, bool p
if (!p_no_cache && ResourceCache::has(local_path)) {
- if (OS::get_singleton()->is_stdout_verbose())
- print_line("load resource: " + local_path + " (cached)");
+ print_verbose("Loading resource: " + local_path + " (cached)");
if (r_error)
*r_error = OK;
return RES(ResourceCache::get(local_path));
@@ -216,9 +215,7 @@ RES ResourceLoader::load(const String &p_path, const String &p_type_hint, bool p
ERR_FAIL_COND_V(path == "", RES());
- if (OS::get_singleton()->is_stdout_verbose())
- print_line("load resource: " + path);
-
+ print_verbose("Loading resource: " + path);
RES res = _load(path, local_path, p_type_hint, p_no_cache, r_error);
if (res.is_null()) {
@@ -286,9 +283,7 @@ Ref<ResourceInteractiveLoader> ResourceLoader::load_interactive(const String &p_
if (!p_no_cache && ResourceCache::has(local_path)) {
- if (OS::get_singleton()->is_stdout_verbose())
- print_line("load resource: " + local_path + " (cached)");
-
+ print_verbose("Loading resource: " + local_path + " (cached)");
Ref<Resource> res_cached = ResourceCache::get(local_path);
Ref<ResourceInteractiveLoaderDefault> ril = Ref<ResourceInteractiveLoaderDefault>(memnew(ResourceInteractiveLoaderDefault));
@@ -298,14 +293,10 @@ Ref<ResourceInteractiveLoader> ResourceLoader::load_interactive(const String &p_
bool xl_remapped = false;
String path = _path_remap(local_path, &xl_remapped);
-
ERR_FAIL_COND_V(path == "", Ref<ResourceInteractiveLoader>());
-
- if (OS::get_singleton()->is_stdout_verbose())
- print_line("load resource: ");
+ print_verbose("Loading resource: " + path);
bool found = false;
-
for (int i = 0; i < loader_count; i++) {
if (!loader[i]->recognize_path(path, p_type_hint))