Logging: Use CLOG for blenkernel
[blender.git] / source / blender / blenkernel / intern / appdir.c
index fc24ccc9fa0344019d54e89d6242341324fd5c8a..86c25b3e0812f631c3d3866faf6f0e4f044b4b50 100644 (file)
@@ -41,6 +41,8 @@
 
 #include "MEM_guardedalloc.h"
 
+#include "CLG_log.h"
+
 #ifdef WIN32
 #  include "utf_winfunc.h"
 #  include "utfconv.h"
@@ -60,6 +62,7 @@
 #endif /* WIN32 */
 
 /* local */
+static CLG_LogRef LOG = {"bke.appdir"};
 static char bprogname[FILE_MAX];    /* full path to program executable */
 static char bprogdir[FILE_MAX];     /* full path to directory in which executable is located */
 static char btempdir_base[FILE_MAX];          /* persistent temporary directory */
@@ -569,7 +572,7 @@ static void where_am_i(char *fullname, const size_t maxlen, const char *name)
                if (GetModuleFileNameW(0, fullname_16, maxlen)) {
                        conv_utf_16_to_8(fullname_16, fullname, maxlen);
                        if (!BLI_exists(fullname)) {
-                               printf("path can't be found: \"%.*s\"\n", (int)maxlen, fullname);
+                               CLOG_ERROR(&LOG, "path can't be found: \"%.*s\"", (int)maxlen, fullname);
                                MessageBox(NULL, "path contains invalid characters or is too long (see console)", "Error", MB_OK);
                        }
                        MEM_freeN(fullname_16);
@@ -605,7 +608,7 @@ static void where_am_i(char *fullname, const size_t maxlen, const char *name)
 
 #if defined(DEBUG)
                if (!STREQ(name, fullname)) {
-                       printf("guessing '%s' == '%s'\n", name, fullname);
+                       CLOG_INFO(&LOG, 2, "guessing '%s' == '%s'", name, fullname);
                }
 #endif
        }
@@ -852,7 +855,7 @@ static void where_is_temp(char *fullname, char *basename, const size_t maxlen, c
                        BLI_add_slash(fullname);
                }
                else {
-                       printf("Warning! Could not generate a temp file name for '%s', falling back to '%s'\n", tmp_name, fullname);
+                       CLOG_WARN(&LOG, "Could not generate a temp file name for '%s', falling back to '%s'", tmp_name, fullname);
                }
 
                MEM_freeN(tmp_name);