0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-01-15 17:16:49 +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_hipri;
extern const bool support_sync; extern const bool support_sync;
extern const bool support_dsync; extern const bool support_dsync;
// Log facility for ircd::fs
extern log::log log;
} }
#include "error.h" #include "error.h"

View file

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

View file

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