Commit 5ff87ca9 authored by Mihai Moldovan's avatar Mihai Moldovan

nxcomp/src/Log.h: use initializer lists instead of initializing member variables in-block.

parent fcb41e32
...@@ -105,12 +105,8 @@ class NXLogStamp ...@@ -105,12 +105,8 @@ class NXLogStamp
} }
NXLogStamp(const char *file, const char *function, int line, NXLogLevel level) NXLogStamp(const char *file, const char *function, int line, NXLogLevel level) : file_(file), function_(function), line_(line), level_(level)
{ {
file_ = std::string(file);
function_ = std::string(function);
line_ = line;
level_ = level;
gettimeofday(&timestamp_, NULL); gettimeofday(&timestamp_, NULL);
} }
...@@ -273,18 +269,9 @@ class NXLog ...@@ -273,18 +269,9 @@ class NXLog
public: public:
NXLog() NXLog() : level_(NXWARNING), stream_(&std::cerr), synchronized_(true), thread_buffer_size_(1024),
{ log_level_(false), log_time_(false), log_unix_time_(false), log_location_(false), log_thread_id_(false)
stream_ = &std::cerr; {
level_ = NXWARNING;
synchronized_ = true;
thread_buffer_size_ = 1024;
log_level_ = false;
log_time_ = false;
log_unix_time_ = false;
log_location_ = false;
log_thread_id_ = false;
if ( pthread_key_create(&tls_key_, free_thread_data) != 0 ) if ( pthread_key_create(&tls_key_, free_thread_data) != 0 )
{ {
std::cerr << "pthread_key_create failed" << std::endl; std::cerr << "pthread_key_create failed" << std::endl;
......
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