mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-24 19:32:30 +08:00
Add and use "should_flog" macro
Useful to figure out if a flog category is enabled. We only use it in one place, but it seems like the sort of thing that should exist.
This commit is contained in:
parent
349b9e9dee
commit
a48926dee5
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user