diff options
author | Mihai Moldovan <ionic@ionic.de> | 2017-12-24 20:07:44 +0100 |
---|---|---|
committer | Mihai Moldovan <ionic@ionic.de> | 2017-12-25 03:15:04 +0100 |
commit | 5ff87ca9eeeacf469edd3cebbd1998173976c192 (patch) | |
tree | e422c21581620cc26ea4549ec3ff12516796f0b9 | |
parent | fcb41e324bad2b3ab43852ed6c24225f00fdd440 (diff) | |
download | nx-libs-5ff87ca9eeeacf469edd3cebbd1998173976c192.tar.gz nx-libs-5ff87ca9eeeacf469edd3cebbd1998173976c192.tar.bz2 nx-libs-5ff87ca9eeeacf469edd3cebbd1998173976c192.zip |
nxcomp/src/Log.h: use initializer lists instead of initializing member variables in-block.
-rw-r--r-- | nxcomp/src/Log.h | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/nxcomp/src/Log.h b/nxcomp/src/Log.h index 3e355a951..68f06bc66 100644 --- a/nxcomp/src/Log.h +++ b/nxcomp/src/Log.h @@ -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(×tamp_, NULL); } @@ -273,18 +269,9 @@ class NXLog public: - NXLog() - { - 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; - + 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) + { if ( pthread_key_create(&tls_key_, free_thread_data) != 0 ) { std::cerr << "pthread_key_create failed" << std::endl; |