1
0
mirror of https://github.com/Zygo/bees.git synced 2025-06-16 17:46:16 +02:00

Merge remote-tracking branch 'kakra/integration' into subvol-threads

This commit is contained in:
Zygo Blaxell
2017-11-11 14:38:17 -05:00
6 changed files with 96 additions and 37 deletions

View File

@ -17,6 +17,7 @@ namespace crucible {
static shared_ptr<set<string>> chatter_names;
static const char *SPACETAB = " \t";
static int chatter_prefix_timestamp = 1;
static
void
@ -52,16 +53,21 @@ namespace crucible {
{
ostringstream header_stream;
time_t ltime;
DIE_IF_MINUS_ONE(time(&ltime));
struct tm ltm;
DIE_IF_ZERO(localtime_r(&ltime, &ltm));
if (chatter_prefix_timestamp) {
time_t ltime;
DIE_IF_MINUS_ONE(time(&ltime));
struct tm ltm;
DIE_IF_ZERO(localtime_r(&ltime, &ltm));
char buf[1024];
DIE_IF_ZERO(strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &ltm));
char buf[1024];
DIE_IF_ZERO(strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &ltm));
header_stream << buf;
header_stream << " " << getpid() << "." << gettid();
} else {
header_stream << "tid " << gettid();
}
header_stream << buf;
header_stream << " " << getpid() << "." << gettid();
if (!m_name.empty()) {
header_stream << " " << m_name;
}
@ -91,6 +97,11 @@ namespace crucible {
c.m_oss.str("");
}
ChatterTimestamp::ChatterTimestamp(int prefix_timestamp)
{
chatter_prefix_timestamp = prefix_timestamp;
}
set<ChatterBox*> ChatterBox::s_boxes;
set<ChatterBox*>& ChatterBox::all_boxes()