0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd::fs: Add and use dedicated log facility for ircd::fs.

This commit is contained in:
Jason Volk 2019-04-07 16:28:21 -07:00
parent e98e4babce
commit 9994836db0
3 changed files with 19 additions and 10 deletions

View file

@ -42,6 +42,9 @@ namespace ircd::fs
extern const bool support_hipri;
extern const bool support_sync;
extern const bool support_dsync;
// Log facility for ircd::fs
extern log::log log;
}
#include "error.h"

View file

@ -26,6 +26,12 @@ namespace ircd::fs
static void debug_paths();
}
decltype(ircd::fs::log)
ircd::fs::log
{
"fs"
};
decltype(ircd::fs::support_sync)
ircd::fs::support_sync
{
@ -1112,7 +1118,7 @@ ircd::fs::aio::init::init()
assert(!context);
log::warning
{
"No support for asynchronous local filesystem IO..."
log, "No support for asynchronous local filesystem IO..."
};
}
#endif
@ -1899,14 +1905,14 @@ ircd::fs::debug_paths()
thread_local char buf[PATH_MAX_LEN + 1];
log::debug
{
"Current working directory: `%s'", cwd(buf)
log, "Current working directory: `%s'", cwd(buf)
};
for_each<base>([](const base &base)
{
log::debug
{
"Working %s is `%s'",
log, "Working %s is `%s'",
basepath::get(base).name,
basepath::get(base).path,
};

View file

@ -494,7 +494,7 @@ try
log::debug
{
"Established head(%p) ring(%p) id:%u fd:%d max_events:%zu max_submit:%zu compat:%x incompat:%x len:%u nr:%u",
log, "Established head(%p) ring(%p) id:%u fd:%d max_events:%zu max_submit:%zu compat:%x incompat:%x len:%u nr:%u",
head.get(),
ring,
head->id,
@ -511,7 +511,7 @@ catch(const std::exception &e)
{
log::error
{
"Error starting AIO context %p :%s",
log, "Error starting AIO context %p :%s",
(const void *)this,
e.what()
};
@ -533,7 +533,7 @@ catch(const std::exception &e)
{
log::critical
{
"Error shutting down AIO context %p :%s",
log, "Error shutting down AIO context %p :%s",
(const void *)this,
e.what()
};
@ -561,7 +561,7 @@ ircd::fs::aio::system::wait()
log::debug
{
"Waiting for AIO context %p", this
log, "Waiting for AIO context %p", this
};
dock.wait([this]
@ -929,7 +929,7 @@ catch(const ctx::interrupted &)
{
log::debug
{
"AIO context %p interrupted", this
log, "AIO context %p interrupted", this
};
ecount = -1;
@ -968,7 +968,7 @@ catch(const std::exception &e)
{
log::error
{
"AIO(%p) handle_events: %s",
log, "AIO(%p) handle_events: %s",
this,
e.what()
};
@ -1016,7 +1016,7 @@ catch(const std::exception &e)
{
log::critical
{
"Unhandled request(%lu) event(%p) error: %s",
log, "Unhandled request(%lu) event(%p) error: %s",
event.data,
&event,
e.what()