]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
log: Use ceph_assert for asserts.
authorAdam C. Emerson <aemerson@redhat.com>
Thu, 23 Aug 2018 15:25:26 +0000 (11:25 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Mon, 27 Aug 2018 13:35:43 +0000 (09:35 -0400)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/log/Log.cc
src/log/SubsystemMap.h

index 6645a4814f10f896b7d85666156a05810cf4e3de..c1f8e76562a4b2f513cf968860ec76af9d85273c 100644 (file)
@@ -61,16 +61,16 @@ Log::Log(const SubsystemMap *s)
   int ret;
 
   ret = pthread_mutex_init(&m_flush_mutex, NULL);
-  assert(ret == 0);
+  ceph_assert(ret == 0);
 
   ret = pthread_mutex_init(&m_queue_mutex, NULL);
-  assert(ret == 0);
+  ceph_assert(ret == 0);
 
   ret = pthread_cond_init(&m_cond_loggers, NULL);
-  assert(ret == 0);
+  ceph_assert(ret == 0);
 
   ret = pthread_cond_init(&m_cond_flusher, NULL);
-  assert(ret == 0);
+  ceph_assert(ret == 0);
 
   m_log_buf = (char*)malloc(MAX_LOG_BUF);
 
@@ -86,7 +86,7 @@ Log::~Log()
     *m_indirect_this = NULL;
   }
 
-  assert(!is_started());
+  ceph_assert(!is_started());
   if (m_fd >= 0)
     VOID_TEMP_FAILURE_RETRY(::close(m_fd));
   free(m_log_buf);
@@ -384,7 +384,7 @@ void Log::_flush(EntryQueue *t, EntryQueue *requeue, bool crash)
                        (unsigned long)e->m_thread, e->m_prio);
 
       line_used += e->snprintf(line + line_used, line_size - line_used - 1);
-      assert(line_used < line_size - 1);
+      ceph_assert(line_used < line_size - 1);
 
       if (do_syslog) {
         syslog(LOG_USER|LOG_INFO, "%s", line);
@@ -489,7 +489,7 @@ void Log::dump_recent()
 
 void Log::start()
 {
-  assert(!is_started());
+  ceph_assert(!is_started());
   pthread_mutex_lock(&m_queue_mutex);
   m_stop = false;
   pthread_mutex_unlock(&m_queue_mutex);
index 042211bd2837aec543e7d9ead2925424b8d46bc1..9df9c9132d189a69de32e2fb3c7fdee03e9a2f1d 100644 (file)
@@ -86,13 +86,13 @@ public:
     }
   }
   bool should_gather(const unsigned sub, int level) const {
-    assert(sub < m_subsys.size());
+    ceph_assert(sub < m_subsys.size());
     return level <= static_cast<int>(m_gather_levels[sub]);
   }
 
   void set_log_level(unsigned subsys, uint8_t log)
   {
-    assert(subsys < m_subsys.size());
+    ceph_assert(subsys < m_subsys.size());
     m_subsys[subsys].log_level = log;
     m_gather_levels[subsys] = \
       std::max(log, m_subsys[subsys].gather_level);
@@ -100,7 +100,7 @@ public:
 
   void set_gather_level(unsigned subsys, uint8_t gather)
   {
-    assert(subsys < m_subsys.size());
+    ceph_assert(subsys < m_subsys.size());
     m_subsys[subsys].gather_level = gather;
     m_gather_levels[subsys] = \
       std::max(m_subsys[subsys].log_level, gather);