This will let us be smarter than putting it on the heap.
Signed-off-by: Sage Weil <sage@newdream.net>
if (0) { \
char __array[((v >= -1) && (v <= 200)) ? 0 : -1] __attribute__((unused)); \
} \
- ceph::log::Entry *_dout_e = new ceph::log::Entry(ceph_clock_now(cct), \
- pthread_self(), \
- v, sub); \
+ ceph::log::Entry *_dout_e = cct->_log->create_entry(v, sub); \
ostringstream _dout_ss; \
CephContext *_dout_cct = cct; \
std::ostream* _dout = &_dout_ss;
pthread_mutex_unlock(&m_queue_mutex);
}
+Entry *Log::create_entry(int level, int subsys)
+{
+ return new Entry(ceph_clock_now(NULL),
+ pthread_self(),
+ level, subsys);
+}
+
void Log::flush()
{
pthread_mutex_lock(&m_flush_mutex);
void set_syslog_level(int log, int crash);
void set_stderr_level(int log, int crash);
+ Entry *create_entry(int level, int subsys);
void submit_entry(Entry *e);
void start();