mirror of
https://github.com/matrix-construct/construct
synced 2024-10-31 19:08:59 +01:00
ircd::log: Eliminate stack buffers; simplify w/ error directory to stderr.
This commit is contained in:
parent
3ed2a32555
commit
3f064ed172
1 changed files with 4 additions and 7 deletions
|
@ -158,12 +158,9 @@ try
|
||||||
}
|
}
|
||||||
catch(const std::exception &e)
|
catch(const std::exception &e)
|
||||||
{
|
{
|
||||||
char buf[BUFSIZE];
|
fprintf(stderr, "!!! Opening log file [%s] failed: %s",
|
||||||
snprintf(buf, sizeof(buf), "!!! Opening log file [%s] failed: %s",
|
fname[fac],
|
||||||
fname[fac],
|
e.what());
|
||||||
e.what());
|
|
||||||
|
|
||||||
std::cerr << buf << std::endl;
|
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -524,7 +521,7 @@ noexcept try
|
||||||
if(likely(s.good()))
|
if(likely(s.good()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char buf[128];
|
thread_local char buf[128];
|
||||||
snprintf(buf, sizeof(buf), "fatal: log stream good[%d] bad[%d] fail[%d] eof[%d]",
|
snprintf(buf, sizeof(buf), "fatal: log stream good[%d] bad[%d] fail[%d] eof[%d]",
|
||||||
s.good(),
|
s.good(),
|
||||||
s.bad(),
|
s.bad(),
|
||||||
|
|
Loading…
Reference in a new issue