0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-19 19:33:45 +02:00

Replace various #if 0 with if constexpr for regression visibility.

This commit is contained in:
Jason Volk 2023-02-09 10:54:24 -08:00
parent 90f1dc77fb
commit fd6f06c1af
6 changed files with 89 additions and 92 deletions

View file

@ -332,18 +332,19 @@ void
ircd::exec::handler::on_exec_setup(executor &ex) ircd::exec::handler::on_exec_setup(executor &ex)
const noexcept const noexcept
{ {
#if 0 // outputs from child; don't want if constexpr((false)) // outputs from child; don't want
assert(e);
log::logf
{ {
log, log::level::DEBUG, assert(e);
"id:%lu pid:%ld `%s' executing...",
e->id, log::logf
e->pid, {
e->path, log, log::level::DEBUG,
}; "id:%lu pid:%ld `%s' executing...",
#endif e->id,
e->pid,
e->path,
};
}
// Set the parent death signal in case of a crash so we won't go zombie. // Set the parent death signal in case of a crash so we won't go zombie.
#if defined(HAVE_SYS_PRCTL_H) #if defined(HAVE_SYS_PRCTL_H)
@ -462,20 +463,21 @@ ircd::exec::handler::on_exec_error(executor &ex,
const std::error_code &ec) const std::error_code &ec)
const noexcept const noexcept
{ {
#if 0 // outputs from child; don't want if constexpr((false)) // outputs from child; don't want
assert(e);
char ecbuf[64];
log::error
{ {
log, "id:%lu pid:%ld `%s' exec() #%ld :%s", assert(e);
e->id,
e->pid, char ecbuf[64];
e->path, log::error
ec.value(), {
string(ecbuf, ec), log, "id:%lu pid:%ld `%s' exec() #%ld :%s",
}; e->id,
#endif e->pid,
e->path,
ec.value(),
string(ecbuf, ec),
};
}
} }
template<class executor> template<class executor>

View file

@ -2273,15 +2273,16 @@ ircd::server::link::submit(request &request)
request.tag? queue.emplace(end(queue), std::move(*request.tag)): request.tag? queue.emplace(end(queue), std::move(*request.tag)):
queue.emplace(end(queue), request) queue.emplace(end(queue), request)
}; };
/*
log::debug if constexpr((false))
{ log::debug
log, "tag(%p) submitted to link(%p) queue: %zu", {
&(*it), log, "tag(%p) submitted to link(%p) queue: %zu",
this, &(*it),
tag_count() this,
}; tag_count()
*/ };
if(ready()) if(ready())
wait_writable(); wait_writable();
} }
@ -2347,14 +2348,13 @@ ircd::server::link::cleanup_canceled()
continue; continue;
} }
#if 0 if constexpr((false))
log::dwarning log::dwarning
{ {
log, "%s removing abandoned tag:%lu", log, "%s removing abandoned tag:%lu",
loghead(*this), loghead(*this),
tag.state.id, tag.state.id,
}; };
#endif
it = queue.erase(it); it = queue.erase(it);
} }

View file

@ -47,14 +47,13 @@ catch(const ctx::interrupted &)
} }
catch(const std::exception &e) catch(const std::exception &e)
{ {
#if 0 if constexpr((false))
log::derror log::derror
{ {
log, "sysfs query `%s' :%s", log, "sysfs query `%s' :%s",
relpath, relpath,
e.what(), e.what(),
}; };
#endif
return {}; return {};
} }

View file

@ -754,21 +754,20 @@ ircd::m::fetch::finish(request &request)
{ {
request.finished = ircd::now<system_point>(); request.finished = ircd::now<system_point>();
#if 0 if constexpr((false))
log::logf log::logf
{ {
log, request.eptr? log::DERROR: log::DEBUG, log, request.eptr? log::DERROR: log::DEBUG,
"Finished %s in %s started:%ld finished:%d attempted:%zu abandon:%b %s%s", "Finished %s in %s started:%ld finished:%d attempted:%zu abandon:%b %s%s",
string_view{request.opts.event_id}, string_view{request.opts.event_id},
string_view{request.opts.room_id}, string_view{request.opts.room_id},
duration_cast<seconds>(tse(request.started)).count(), duration_cast<seconds>(tse(request.started)).count(),
duration_cast<seconds>(tse(request.finished)).count(), duration_cast<seconds>(tse(request.finished)).count(),
request.attempted.size(), request.attempted.size(),
!request.promise, !request.promise,
request.eptr? " :" : "", request.eptr? " :" : "",
what(request.eptr), what(request.eptr),
}; };
#endif
if(!request.promise) if(!request.promise)
return; return;

View file

@ -1397,14 +1397,13 @@ ircd::m::vm::call_hook(hook::site<T> &hook,
T&& data) T&& data)
try try
{ {
#if 0 if constexpr((false))
log::debug log::debug
{ {
log, "%s hook:%s enter", log, "%s hook:%s enter",
loghead(eval), loghead(eval),
hook.name(), hook.name(),
}; };
#endif
// Providing a pointer to the eval.hook pointer allows the hook site to // Providing a pointer to the eval.hook pointer allows the hook site to
// provide updates for observers in other contexts for which hook is // provide updates for observers in other contexts for which hook is
@ -1416,14 +1415,13 @@ try
hook(cur, event, std::forward<T>(data)); hook(cur, event, std::forward<T>(data));
#if 0 if constexpr((false))
log::debug log::debug
{ {
log, "%s hook:%s leave", log, "%s hook:%s leave",
loghead(eval), loghead(eval),
hook.name(), hook.name(),
}; };
#endif
} }
catch(const m::error &e) catch(const m::error &e)
{ {

View file

@ -148,18 +148,17 @@ try
event, rule, opts event, rule, opts
}; };
#if 0 if constexpr((false))
log::debug log::debug
{ {
log, "event %s rule { %s, %s, %s } for %s %s", log, "event %s rule { %s, %s, %s } for %s %s",
string_view{event.event_id}, string_view{event.event_id},
scope, scope,
kind, kind,
ruleid, ruleid,
string_view{user_id}, string_view{user_id},
bool(match)? "MATCH"_sv : string_view{} bool(match)? "MATCH"_sv : string_view{}
}; };
#endif
return bool(match); return bool(match);
} }