diff options
| author | 2017-03-16 23:35:36 -0400 | |
|---|---|---|
| committer | 2017-03-16 23:35:36 -0400 | |
| commit | 3e7459bbf9efa80b2d2dd45b892f7f3cef8ab751 (patch) | |
| tree | a26da0ad85b28d10c6b7840f55d3ac0a0ead3c0d /src/common/file_util.cpp | |
| parent | Merge pull request #2468 from Kloen/xamarin-pls-stop (diff) | |
| parent | file_util: Log when using local user directory (diff) | |
| download | yuzu-3e7459bbf9efa80b2d2dd45b892f7f3cef8ab751.tar.gz yuzu-3e7459bbf9efa80b2d2dd45b892f7f3cef8ab751.tar.xz yuzu-3e7459bbf9efa80b2d2dd45b892f7f3cef8ab751.zip | |
Merge pull request #2618 from wwylele/log-less-filename
Reduce host file name and path logging
Diffstat (limited to 'src/common/file_util.cpp')
| -rw-r--r-- | src/common/file_util.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index df234c225..5ab036b34 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp | |||
| @@ -118,8 +118,7 @@ bool IsDirectory(const std::string& filename) { | |||
| 118 | #endif | 118 | #endif |
| 119 | 119 | ||
| 120 | if (result < 0) { | 120 | if (result < 0) { |
| 121 | LOG_WARNING(Common_Filesystem, "stat failed on %s: %s", filename.c_str(), | 121 | LOG_DEBUG(Common_Filesystem, "stat failed on %s: %s", filename.c_str(), GetLastErrorMsg()); |
| 122 | GetLastErrorMsg()); | ||
| 123 | return false; | 122 | return false; |
| 124 | } | 123 | } |
| 125 | 124 | ||
| @@ -129,12 +128,12 @@ bool IsDirectory(const std::string& filename) { | |||
| 129 | // Deletes a given filename, return true on success | 128 | // Deletes a given filename, return true on success |
| 130 | // Doesn't supports deleting a directory | 129 | // Doesn't supports deleting a directory |
| 131 | bool Delete(const std::string& filename) { | 130 | bool Delete(const std::string& filename) { |
| 132 | LOG_INFO(Common_Filesystem, "file %s", filename.c_str()); | 131 | LOG_TRACE(Common_Filesystem, "file %s", filename.c_str()); |
| 133 | 132 | ||
| 134 | // Return true because we care about the file no | 133 | // Return true because we care about the file no |
| 135 | // being there, not the actual delete. | 134 | // being there, not the actual delete. |
| 136 | if (!Exists(filename)) { | 135 | if (!Exists(filename)) { |
| 137 | LOG_WARNING(Common_Filesystem, "%s does not exist", filename.c_str()); | 136 | LOG_DEBUG(Common_Filesystem, "%s does not exist", filename.c_str()); |
| 138 | return true; | 137 | return true; |
| 139 | } | 138 | } |
| 140 | 139 | ||
| @@ -169,8 +168,7 @@ bool CreateDir(const std::string& path) { | |||
| 169 | return true; | 168 | return true; |
| 170 | DWORD error = GetLastError(); | 169 | DWORD error = GetLastError(); |
| 171 | if (error == ERROR_ALREADY_EXISTS) { | 170 | if (error == ERROR_ALREADY_EXISTS) { |
| 172 | LOG_WARNING(Common_Filesystem, "CreateDirectory failed on %s: already exists", | 171 | LOG_DEBUG(Common_Filesystem, "CreateDirectory failed on %s: already exists", path.c_str()); |
| 173 | path.c_str()); | ||
| 174 | return true; | 172 | return true; |
| 175 | } | 173 | } |
| 176 | LOG_ERROR(Common_Filesystem, "CreateDirectory failed on %s: %i", path.c_str(), error); | 174 | LOG_ERROR(Common_Filesystem, "CreateDirectory failed on %s: %i", path.c_str(), error); |
| @@ -182,7 +180,7 @@ bool CreateDir(const std::string& path) { | |||
| 182 | int err = errno; | 180 | int err = errno; |
| 183 | 181 | ||
| 184 | if (err == EEXIST) { | 182 | if (err == EEXIST) { |
| 185 | LOG_WARNING(Common_Filesystem, "mkdir failed on %s: already exists", path.c_str()); | 183 | LOG_DEBUG(Common_Filesystem, "mkdir failed on %s: already exists", path.c_str()); |
| 186 | return true; | 184 | return true; |
| 187 | } | 185 | } |
| 188 | 186 | ||
| @@ -197,7 +195,7 @@ bool CreateFullPath(const std::string& fullPath) { | |||
| 197 | LOG_TRACE(Common_Filesystem, "path %s", fullPath.c_str()); | 195 | LOG_TRACE(Common_Filesystem, "path %s", fullPath.c_str()); |
| 198 | 196 | ||
| 199 | if (FileUtil::Exists(fullPath)) { | 197 | if (FileUtil::Exists(fullPath)) { |
| 200 | LOG_WARNING(Common_Filesystem, "path exists %s", fullPath.c_str()); | 198 | LOG_DEBUG(Common_Filesystem, "path exists %s", fullPath.c_str()); |
| 201 | return true; | 199 | return true; |
| 202 | } | 200 | } |
| 203 | 201 | ||
| @@ -229,7 +227,7 @@ bool CreateFullPath(const std::string& fullPath) { | |||
| 229 | 227 | ||
| 230 | // Deletes a directory filename, returns true on success | 228 | // Deletes a directory filename, returns true on success |
| 231 | bool DeleteDir(const std::string& filename) { | 229 | bool DeleteDir(const std::string& filename) { |
| 232 | LOG_INFO(Common_Filesystem, "directory %s", filename.c_str()); | 230 | LOG_TRACE(Common_Filesystem, "directory %s", filename.c_str()); |
| 233 | 231 | ||
| 234 | // check if a directory | 232 | // check if a directory |
| 235 | if (!FileUtil::IsDirectory(filename)) { | 233 | if (!FileUtil::IsDirectory(filename)) { |
| @@ -693,6 +691,8 @@ const std::string& GetUserPath(const unsigned int DirIDX, const std::string& new | |||
| 693 | paths[D_USER_IDX] = GetExeDirectory() + DIR_SEP USERDATA_DIR DIR_SEP; | 691 | paths[D_USER_IDX] = GetExeDirectory() + DIR_SEP USERDATA_DIR DIR_SEP; |
| 694 | if (!FileUtil::IsDirectory(paths[D_USER_IDX])) { | 692 | if (!FileUtil::IsDirectory(paths[D_USER_IDX])) { |
| 695 | paths[D_USER_IDX] = AppDataRoamingDirectory() + DIR_SEP EMU_DATA_DIR DIR_SEP; | 693 | paths[D_USER_IDX] = AppDataRoamingDirectory() + DIR_SEP EMU_DATA_DIR DIR_SEP; |
| 694 | } else { | ||
| 695 | LOG_INFO(Common_Filesystem, "Using the local user directory"); | ||
| 696 | } | 696 | } |
| 697 | 697 | ||
| 698 | paths[D_CONFIG_IDX] = paths[D_USER_IDX] + CONFIG_DIR DIR_SEP; | 698 | paths[D_CONFIG_IDX] = paths[D_USER_IDX] + CONFIG_DIR DIR_SEP; |