]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Shrink Logger from 32 to 24 bytes
authorPieter Lexis <pieter.lexis@powerdns.com>
Fri, 22 May 2015 15:00:53 +0000 (17:00 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Fri, 19 Jun 2015 18:14:19 +0000 (20:14 +0200)
Make Urgency 2 bytes instead of 4.

pdns/logger.hh

index f74f4a1acf8ca29274b019111a66bc951c71a5d5..27c565f65be112c6a2af4106ffadd7a9148c0b94 100644 (file)
@@ -39,7 +39,7 @@ public:
   Logger(const string &, int facility=LOG_DAEMON); //!< pass the identification you wish to appear in the log
 
   //! The urgency of a log message
-  enum Urgency {All=99999,NTLog=12345,Alert=LOG_ALERT, Critical=LOG_CRIT, Error=LOG_ERR, Warning=LOG_WARNING,
+  enum Urgency : int16_t {All=32767,NTLog=12345,Alert=LOG_ALERT, Critical=LOG_CRIT, Error=LOG_ERR, Warning=LOG_WARNING,
                Notice=LOG_NOTICE,Info=LOG_INFO, Debug=LOG_DEBUG, None=-1};
 
   /** Log a message.
@@ -92,12 +92,13 @@ private:
   static void perThreadDestructor(void *);
   PerThread* getPerThread();
   void open();
+
   string name;
   int flags;
   int d_facility;
-  bool opened;
   Urgency d_loglevel;
   Urgency consoleUrgency;
+  bool opened;
   static pthread_once_t s_once;
   static pthread_key_t s_loggerKey;
 };