mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 02:02:38 +01:00
modules/web_root: Add more infolog diagnostics on init.
This commit is contained in:
parent
d5206cd22c
commit
5ac0ac8229
1 changed files with 29 additions and 1 deletions
|
@ -89,7 +89,14 @@ init_files()
|
|||
};
|
||||
|
||||
if(empty(path))
|
||||
{
|
||||
log::warning
|
||||
{
|
||||
"Conf item 'ircd.web.root.path' is empty; not serving static assets."
|
||||
};
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(!fs::exists(path))
|
||||
{
|
||||
|
@ -103,9 +110,30 @@ init_files()
|
|||
|
||||
for(const auto &file : fs::ls_r(path))
|
||||
{
|
||||
const auto name(lstrip(file, path));
|
||||
const auto name
|
||||
{
|
||||
lstrip(file, path)
|
||||
};
|
||||
|
||||
files.emplace(std::string(name), file);
|
||||
}
|
||||
|
||||
if(files.empty())
|
||||
{
|
||||
log::dwarning
|
||||
{
|
||||
"No files or directories found at `%s'; not serving any static assets."
|
||||
};
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
log::info
|
||||
{
|
||||
"Web root loaded %zu file and directory resources for service under `%s'",
|
||||
files.size(),
|
||||
path,
|
||||
};
|
||||
}
|
||||
|
||||
/// This handler exists because the root resource on path "/" catches
|
||||
|
|
Loading…
Reference in a new issue