diff options
Diffstat (limited to 'src/buildtool/file_system/file_system_manager.hpp')
-rw-r--r-- | src/buildtool/file_system/file_system_manager.hpp | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/src/buildtool/file_system/file_system_manager.hpp b/src/buildtool/file_system/file_system_manager.hpp index d0c70ff2..674d87f4 100644 --- a/src/buildtool/file_system/file_system_manager.hpp +++ b/src/buildtool/file_system/file_system_manager.hpp @@ -748,7 +748,6 @@ class FileSystemManager { } } - template <bool kLogError = true> [[nodiscard]] static auto CopyFileImpl( std::filesystem::path const& src, std::filesystem::path const& dst, @@ -758,40 +757,31 @@ class FileSystemManager { try { return std::filesystem::copy_file(src, dst, opt); } catch (std::exception const& e) { - if constexpr (kLogError) { - Logger::Log(LogLevel::Error, - "copying file from {} to {}:\n{}", - src.string(), - dst.string(), - e.what()); - } + Logger::Log(LogLevel::Error, + "copying file from {} to {}:\n{}", + src.string(), + dst.string(), + e.what()); return false; } } - template <bool kLogError = true> [[nodiscard]] static auto WriteFileImpl( std::string const& content, std::filesystem::path const& file) noexcept -> bool { try { std::ofstream writer{file}; if (!writer.is_open()) { - if constexpr (kLogError) { - Logger::Log( - LogLevel::Error, "can not open file {}", file.string()); - } + Logger::Log( + LogLevel::Error, "can not open file {}", file.string()); return false; } writer << content; writer.close(); return true; } catch (std::exception const& e) { - if constexpr (kLogError) { - Logger::Log(LogLevel::Error, - "writing to {}:\n{}", - file.string(), - e.what()); - } + Logger::Log( + LogLevel::Error, "writing to {}:\n{}", file.string(), e.what()); return false; } } |