Commit a54b4f4c authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 8af4d305
......@@ -171,9 +171,8 @@ error _Conn::_pinner(context::Context ctx) {
// print to stderr as well as by default log does not print to there.
// XXX also catch panic/exc ?
if (!(err == nil || errors::Is(err, context::canceled))) { // canceled = .close asks pinner to stop
xlog::Fatalf("CRITICAL: %s", v(err));
xlog::Fatalf("CRITICAL: wcfs server will likely kill us soon.");
log::Fatalf("CRITICAL: %s", v(err));
log::Fatalf("CRITICAL: wcfs server will likely kill us soon.");
fprintf(stderr, "CRITICAL: %s\n", v(err));
fprintf(stderr, "CRITICAL: wcfs server will likely kill us soon.\n");
}
......
......@@ -247,8 +247,9 @@ error Contextf::operator() (error err) const {
#include <sys/types.h>
#include <sys/syscall.h>
// xlog::
namespace xlog {
// golang::log::
namespace golang {
namespace log {
void __Logf(const char *file, int line, char level, const char *format, ...) {
double t = time::now();
......@@ -263,7 +264,7 @@ void __Logf(const char *file, int line, char level, const char *format, ...) {
pid_t tid = syscall(SYS_gettid);
string prefix = fmt::sprintf("%c%s.%06d %d %s:%d] ", level, t_buf, t_us, tid, file, line);
string prefix = fmt::sprintf("%c%s.%06d % 7d %s:%d] ", level, t_buf, t_us, tid, file, line);
// XXX better to emit prefix and msg in one go.
fprintf(stderr, "%s", v(prefix));
......@@ -275,7 +276,7 @@ void __Logf(const char *file, int line, char level, const char *format, ...) {
fprintf(stderr, "\n");
}
} // xlog
}} // golang::log::
// wcfs::
......
......@@ -168,13 +168,14 @@ public:
} // xerr::
// xlog::
namespace xlog {
// golang::log:: TODO -> pygolang
namespace golang {
namespace log {
#define Fatalf(format, ...) __Logf(__FILE__, __LINE__, 'F', format, ##__VA_ARGS__)
void __Logf(const char *file, int line, char level, const char *format, ...);
} // xlog::
}} // golang::log::
// wcfs::
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment