diff --git a/src/core/context.cpp b/src/core/context.cpp index c752c5c..deeda38 100644 --- a/src/core/context.cpp +++ b/src/core/context.cpp @@ -185,7 +185,11 @@ bool context::enabled(level lv) void context::set_log_file(const fs::path& p) { - if (!p.empty()) + // creating directory + if (!exists(p.parent_path())) + op::create_directories(gcx(), paths::prefix()); + + if (!conf::dry() && !p.empty()) { HANDLE h = CreateFileW( p.native().c_str(), GENERIC_WRITE, FILE_SHARE_READ,