diff --git a/src/flog.h b/src/flog.h index 178016af7..5a4acf5a2 100644 --- a/src/flog.h +++ b/src/flog.h @@ -182,3 +182,6 @@ void log_extra_to_flog_file(const wcstring &s); } while (0) #endif + +#define should_flog(wht) \ + (flog_details::category_list_t::g_instance->wht.enabled) diff --git a/src/io.cpp b/src/io.cpp index ed241237b..afdc8ec0a 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -257,7 +257,7 @@ bool io_chain_t::append_from_specs(const redirection_spec_list_t &specs, const w FLOGF(warning, NOCLOB_ERROR, spec.target.c_str()); } else { FLOGF(warning, FILE_ERROR, spec.target.c_str()); - if (should_debug(1)) wperror(L"open"); + if (should_flog(warning)) wperror(L"open"); } return false; }