Migrate remaining calls from debug_safe to FLOGF_SAFE

This removes debug_level and remaining debug bits.

We also simplify some of the exec errors, reducing them to a single
line.
This commit is contained in:
ridiculousfish
2021-07-05 14:29:24 -07:00
parent 28bf44d698
commit b395b33776
8 changed files with 43 additions and 155 deletions

View File

@@ -296,17 +296,7 @@ static int fish_parse_opt(int argc, char **argv, fish_cmd_opts_t *opts) {
break;
}
case 'd': {
char *end;
long tmp;
errno = 0;
tmp = strtol(optarg, &end, 10);
if (tmp >= 0 && tmp <= 10 && !*end && !errno) {
debug_level = static_cast<int>(tmp);
} else {
activate_flog_categories_by_pattern(str2wcstring(optarg));
}
activate_flog_categories_by_pattern(str2wcstring(optarg));
for (auto cat : get_flog_categories()) {
if (cat->enabled) {
std::fwprintf(stdout, L"Debug enabled for category: %ls\n", cat->name);