morningman closed pull request #376: Remove OLAP_LOG_FATAL log format. Use 
LOG(FATAL) instead
URL: https://github.com/apache/incubator-doris/pull/376
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/be/src/olap/base_compaction.cpp b/be/src/olap/base_compaction.cpp
index f77867bc..121b14b6 100644
--- a/be/src/olap/base_compaction.cpp
+++ b/be/src/olap/base_compaction.cpp
@@ -167,7 +167,7 @@ OLAPStatus BaseCompaction::run() {
             }
 
             ++sleep_count;
-            OLAP_LOG_FATAL("base compaction's delete action has error.sleep 1 
minute...");
+            LOG(FATAL) << "base compaction's delete action has error.sleep 1 
minute...";
             sleep(60);
         }
 
@@ -293,10 +293,10 @@ bool BaseCompaction::_check_whether_satisfy_policy(bool 
is_manual_trigger,
     double cumulative_base_ratio = static_cast<double>(cumulative_total_size) 
/ base_size;
     if (cumulative_base_ratio > base_cumulative_delta_ratio) {
         LOG(INFO) << "satisfy the base compaction policy. table=" << 
_table->full_name()
-            << "cumualtive_total_size=" << cumulative_total_size
-            << "base_size=" << base_size
-            << "cumulative_base_ratio=" << cumulative_base_ratio
-            << "policy_ratio=" << base_cumulative_delta_ratio;
+            << ", cumualtive_total_size=" << cumulative_total_size
+            << ", base_size=" << base_size
+            << ", cumulative_base_ratio=" << cumulative_base_ratio
+            << ", policy_ratio=" << base_cumulative_delta_ratio;
         return true;
     }
 
@@ -430,11 +430,10 @@ OLAPStatus BaseCompaction::_update_header(uint64_t 
row_count, vector<SegmentGrou
                                        &_new_olap_indices,
                                        unused_olap_indices);
     if (res != OLAP_SUCCESS) {
-        OLAP_LOG_FATAL("fail to replace data sources. "
-                       "[res=%d table=%s; new_base=%d; old_base=%d]",
-                       _table->full_name().c_str(),
-                       _new_base_version.second,
-                       _old_base_version.second);
+        LOG(FATAL) << "fail to replace data sources. res" << res
+                   << ", tablet=" << _table->full_name()
+                   << ", new_base_version=" << _new_base_version.second
+                   << ", old_base_verison=" << _old_base_version.second;
         return res;
     }
 
@@ -448,11 +447,10 @@ OLAPStatus BaseCompaction::_update_header(uint64_t 
row_count, vector<SegmentGrou
     // 暂时没办法做很好的处理,报FATAL
     res = _table->save_header();
     if (res != OLAP_SUCCESS) {
-        OLAP_LOG_FATAL("fail to save header. "
-                       "[res=%d table=%s; new_base=%d; old_base=%d]",
-                       _table->full_name().c_str(),
-                       _new_base_version.second,
-                       _old_base_version.second);
+        LOG(FATAL) << "fail to save header. res=" << res
+                   << ", tablet=" << _table->full_name()
+                   << ", new_base_version=" << _new_base_version.second
+                   << ", old_base_version=" << _old_base_version.second;
         return OLAP_ERR_BE_SAVE_HEADER_ERROR;
     }
     _new_olap_indices.clear();
diff --git a/be/src/olap/byte_buffer.cpp b/be/src/olap/byte_buffer.cpp
index 18f41ec7..515b6162 100644
--- a/be/src/olap/byte_buffer.cpp
+++ b/be/src/olap/byte_buffer.cpp
@@ -44,8 +44,10 @@ void StorageByteBuffer::BufDeleter::operator()(char* p) {
 
     if (_is_mmap) {
         if (0 != munmap(p, _mmap_length)) {
-            OLAP_LOG_FATAL("fail to munmap: [mem='%p', len='%lu', errno='%d' 
errno_str='%s']",
-                    p, _mmap_length, Errno::no(), Errno::str());
+            LOG(FATAL) << "fail to munmap: mem=" << p
+                       << ", len=" << _mmap_length
+                       << ", errno=" << Errno::no()
+                       << ", errno_str=" << Errno::str();
         }
     } else {
         delete []p;
diff --git a/be/src/olap/column_data.cpp b/be/src/olap/column_data.cpp
index 00e70213..354dd977 100644
--- a/be/src/olap/column_data.cpp
+++ b/be/src/olap/column_data.cpp
@@ -253,7 +253,7 @@ OLAPStatus ColumnData::_find_position_by_full_key(
         OLAP_LOG_DEBUG("get result iterator. [offset=%u start_pos='%s']", 
                 *it_result, start_position.to_string().c_str());
     } catch (std::exception& e) {
-        OLAP_LOG_FATAL("exception happens when doing seek. [e.what='%s']", 
e.what());
+        LOG(FATAL) << "exception happens when doing seek. exception=" << 
e.what();
         return OLAP_ERR_STL_ERROR;
     }
 
diff --git a/be/src/olap/column_data.h b/be/src/olap/column_data.h
index daee11e4..78220bf0 100644
--- a/be/src/olap/column_data.h
+++ b/be/src/olap/column_data.h
@@ -233,7 +233,7 @@ class ColumnDataComparator {
         OLAPStatus res = OLAP_SUCCESS;
         RowBlockPosition position = _start_block_position;
         if (OLAP_SUCCESS != (res = _segment_group->advance_row_block(index, 
&position))) {
-            OLAP_LOG_FATAL("fail to advance row block. [res=%d]", res);
+            LOG(FATAL) << "fail to advance row block. res=" << res;
             throw ComparatorException();
         }
         const RowCursor* helper_cursor = 
_olap_data->seek_and_get_current_row(position);
diff --git a/be/src/olap/cumulative_compaction.cpp 
b/be/src/olap/cumulative_compaction.cpp
index 168c452e..34f954f8 100755
--- a/be/src/olap/cumulative_compaction.cpp
+++ b/be/src/olap/cumulative_compaction.cpp
@@ -77,7 +77,7 @@ OLAPStatus CumulativeCompaction::init(OLAPTablePtr table) {
 
     if (!_validate_need_merged_versions()) {
         _table->release_cumulative_lock();
-        OLAP_LOG_FATAL("error! invalid need merged versions");
+        LOG(FATAL) << "error! invalid need merged versions.";
         return OLAP_ERR_CUMULATIVE_INVALID_NEED_MERGED_VERSIONS;
     }
 
@@ -401,9 +401,11 @@ OLAPStatus 
CumulativeCompaction::_do_cumulative_compaction() {
     bool row_nums_check = config::row_nums_check;
     if (row_nums_check) {
         if (source_rows != _new_segment_group->num_rows() + merged_rows + 
filted_rows) {
-            OLAP_LOG_FATAL("fail to check row num! "
-                           "[source_rows=%lu merged_rows=%lu filted_rows=%lu 
new_index_rows=%lu]",
-                           source_rows, merged_rows, filted_rows, 
_new_segment_group->num_rows());
+            LOG(FATAL) << "fail to check row num! "
+                       << "source_rows=" << source_rows
+                       << ", merged_rows=" << merged_rows
+                       << ", filted_rows=" << filted_rows
+                       << ", new_index_rows=" << 
_new_segment_group->num_rows();
             return OLAP_ERR_CHECK_LINES_ERROR;
         }
     } else {
@@ -430,11 +432,10 @@ OLAPStatus 
CumulativeCompaction::_do_cumulative_compaction() {
     // 4. validate that delete action is right
     res = _validate_delete_file_action();
     if (res != OLAP_SUCCESS) {
-        OLAP_LOG_FATAL("delete action of cumulative compaction has error. roll 
back."
-                       "[table=%s; cumulative_version=%d-%d]",
-                       _table->full_name().c_str(),
-                       _cumulative_version.first,
-                       _cumulative_version.second);
+        LOG(FATAL) << "delete action of cumulative compaction has error. roll 
back."
+                   << "tablet=" << _table->full_name()
+                   << ", cumulative_version=" << _cumulative_version.first 
+                   << "-" << _cumulative_version.second;
         // if error happened, roll back
         OLAPStatus ret = _roll_back(unused_indices);
         if (ret != OLAP_SUCCESS) {
@@ -465,15 +466,15 @@ OLAPStatus 
CumulativeCompaction::_update_header(vector<SegmentGroup*>* unused_in
     OLAPStatus res = OLAP_SUCCESS;
     res = _table->replace_data_sources(&_need_merged_versions, &new_indices, 
unused_indices);
     if (res != OLAP_SUCCESS) {
-        OLAP_LOG_FATAL("failed to replace data sources. [res=%d table=%s]",
-                       res, _table->full_name().c_str());
+        LOG(FATAL) << "failed to replace data sources. res=" << res
+                   << ", tablet=" << _table->full_name();
         return res;
     }
 
     res = _table->save_header();
     if (res != OLAP_SUCCESS) {
-        OLAP_LOG_FATAL("failed to save header. [res=%d table=%s]",
-                       res, _table->full_name().c_str());
+        LOG(FATAL) << "failed to save header. res=" << res
+                   << ", tablet=" << _table->full_name();
         return res;
     }
 
diff --git a/be/src/olap/delete_handler.cpp b/be/src/olap/delete_handler.cpp
index 272311ef..93b34d1d 100644
--- a/be/src/olap/delete_handler.cpp
+++ b/be/src/olap/delete_handler.cpp
@@ -366,7 +366,7 @@ OLAPStatus DeleteHandler::init(OLAPTablePtr olap_table, 
int32_t version) {
         temp.del_cond = new(std::nothrow) Conditions();
 
         if (temp.del_cond == NULL) {
-            OLAP_LOG_FATAL("fail to malloc Conditions. [size=%ld]", 
sizeof(Conditions));
+            LOG(FATAL) << "fail to malloc Conditions. size=" << 
sizeof(Conditions);
             return OLAP_ERR_MALLOC_ERROR;
         }
 
diff --git a/be/src/olap/lru_cache.cpp b/be/src/olap/lru_cache.cpp
index 66860c7f..a74c4274 100644
--- a/be/src/olap/lru_cache.cpp
+++ b/be/src/olap/lru_cache.cpp
@@ -125,7 +125,7 @@ bool HandleTable::_resize() {
 
     // assert(new_list);
     if (NULL == new_list) {
-        OLAP_LOG_FATAL("failed to malloc new hash list. [new_length=%d]", 
new_length);
+        LOG(FATAL) << "failed to malloc new hash list. new_length=" << 
new_length;
         return false;
     }
 
@@ -150,7 +150,8 @@ bool HandleTable::_resize() {
     //assert(_elems == count);
     if (_elems != count) {
         delete [] new_list;
-        OLAP_LOG_FATAL("_elems not match new count. [_elems=%d count=%d]", 
_elems, count);
+        LOG(FATAL) << "_elems not match new count. elems=" << _elems
+                   << ", count=" << count;
         return false;
     }
 
@@ -192,8 +193,8 @@ void LRUCache::_ref(LRUHandle* e) {
 void LRUCache::_unref(LRUHandle* e) {
     // assert(e->refs > 0);
     if (e->refs <= 0) {
-        OLAP_LOG_FATAL("e->refs > 0, i do not know why, anyway, is something 
wrong."
-                "[e->refs=%d]", e->refs);
+        LOG(FATAL) << "e->refs > 0, i do not know why, anyway, is something 
wrong."
+                   << "e->refs=" << e->refs;
         return;
     }
     e->refs--;
diff --git a/be/src/olap/olap_engine.cpp b/be/src/olap/olap_engine.cpp
index 92db65d3..dd0d050c 100644
--- a/be/src/olap/olap_engine.cpp
+++ b/be/src/olap/olap_engine.cpp
@@ -711,11 +711,9 @@ void OLAPEngine::_delete_tables_on_unused_root_path() {
     }
 
     if (_used_disk_not_enough(unused_root_path_num, total_root_path_num)) {
-        OLAP_LOG_FATAL("engine stop running, because more than %d disks error."
-                       "[total_disks=%d error_disks=%d]",
-                       _min_percentage_of_error_disk,
-                       total_root_path_num,
-                       unused_root_path_num);
+        LOG(FATAL) << "engine stop running, because more than " << 
_min_percentage_of_error_disk
+                   << " disks error. total_disks=" << total_root_path_num
+                   << ", error_disks=" << unused_root_path_num;
         exit(0);
     }
 
@@ -1360,8 +1358,8 @@ OLAPStatus OLAPEngine::drop_table(
     related_table->clear_schema_change_request();
     res = related_table->save_header();
     if (res != OLAP_SUCCESS) {
-        OLAP_LOG_FATAL("fail to save table header. [res=%d table=%s]",
-                       res, related_table->full_name().c_str());
+        LOG(FATAL) << "fail to save table header. res=" << res
+                   << ", tablet=" << related_table->full_name();
     }
 
     res = _drop_table_directly_unlocked(tablet_id, schema_hash, keep_files);
@@ -2463,7 +2461,7 @@ OLAPStatus OLAPEngine::compute_checksum(
         ReadLock rdlock(tablet->get_header_lock_ptr());
         const PDelta* message = tablet->lastest_version();
         if (message == NULL) {
-            OLAP_LOG_FATAL("fail to get latest version. [tablet_id=%ld]", 
tablet_id);
+            LOG(FATAL) << "fail to get latest version. tablet_id=" << 
tablet_id;
             return OLAP_ERR_VERSION_NOT_EXIST;
         }
 
diff --git a/be/src/olap/out_stream.cpp b/be/src/olap/out_stream.cpp
index 53079349..3bbe0796 100644
--- a/be/src/olap/out_stream.cpp
+++ b/be/src/olap/out_stream.cpp
@@ -41,7 +41,7 @@ OutStreamFactory::OutStreamFactory(CompressKind 
compress_kind, uint32_t stream_b
         break;
 
     default:
-        OLAP_LOG_FATAL("unknown compress kind. [kind=%d]", compress_kind);
+        LOG(FATAL) << "unknown compress kind. kind=" << compress_kind;
     }
 }
 
diff --git a/be/src/olap/push_handler.cpp b/be/src/olap/push_handler.cpp
index 13075e2e..3f884aae 100644
--- a/be/src/olap/push_handler.cpp
+++ b/be/src/olap/push_handler.cpp
@@ -849,8 +849,8 @@ OLAPStatus PushHandler::_update_header(
             new_indices,
             unused_indices);
     if (res != OLAP_SUCCESS) {
-        OLAP_LOG_FATAL("fail to replace data sources. [res=%d table='%s']",
-                       res, olap_table->full_name().c_str());
+        LOG(FATAL) << "fail to replace data sources. res=" << res
+                   << ", tablet=" << olap_table->full_name();
         return res;
     }
 
@@ -891,8 +891,8 @@ OLAPStatus PushHandler::_clear_alter_table_info(
         res = SchemaChangeHandler::clear_schema_change_single_info(
                 tablet, NULL, false, false);
         if (res != OLAP_SUCCESS) {
-            OLAP_LOG_FATAL("fail to clear schema change info of new table. 
[res=%d table='%s']",
-                           res, tablet->full_name().c_str());
+            LOG(FATAL) << "fail to clear schema change info of new table. 
res=" << res
+                       << ", tablet=" << tablet->full_name();
             break;
         }
         
@@ -911,8 +911,8 @@ OLAPStatus PushHandler::_clear_alter_table_info(
             res = SchemaChangeHandler::clear_schema_change_single_info(
                     related_tablet, NULL, false, false);
             if (res != OLAP_SUCCESS) {
-                OLAP_LOG_FATAL("fail to clear schema change info of old table. 
[res=%d table='%s']",
-                               res, related_tablet->full_name().c_str());
+                LOG(FATAL) << "fail to clear schema change info of old table. 
res=" << res
+                           << ", tablet=" << related_tablet->full_name();
                 break;
             }
             
diff --git a/be/src/olap/row_block.cpp b/be/src/olap/row_block.cpp
index 79e18712..614041b6 100644
--- a/be/src/olap/row_block.cpp
+++ b/be/src/olap/row_block.cpp
@@ -300,7 +300,7 @@ OLAPStatus RowBlock::find_row(const RowCursor& key,
             *row_index = *it_result;
         }
     } catch (exception& e) {
-        OLAP_LOG_FATAL("exception happens. [e.what='%s']", e.what());
+        LOG(FATAL) << "exception happens. exception=" << e.what();
         return OLAP_ERR_ROWBLOCK_FIND_ROW_EXCEPTION;
     }
 
diff --git a/be/src/olap/run_length_integer_writer.cpp 
b/be/src/olap/run_length_integer_writer.cpp
index fca56b55..b1e1493e 100644
--- a/be/src/olap/run_length_integer_writer.cpp
+++ b/be/src/olap/run_length_integer_writer.cpp
@@ -215,7 +215,7 @@ void RunLengthIntegerWriter::_determined_encoding() {
     }
 
     // never happen
-    OLAP_LOG_FATAL("ops: fail to determine encoding type.");
+    LOG(FATAL) << "ops: fail to determine encoding type.";
 }
 
 void RunLengthIntegerWriter::_prepare_patched_blob() {
diff --git a/be/src/olap/schema_change.cpp b/be/src/olap/schema_change.cpp
index 67c42524..b5f8889b 100644
--- a/be/src/olap/schema_change.cpp
+++ b/be/src/olap/schema_change.cpp
@@ -162,7 +162,7 @@ bool RowBlockChanger::change_row_block(
         RowBlock* mutable_block,
         uint64_t* filted_rows) const {
     if (mutable_block == NULL) {
-        OLAP_LOG_FATAL("mutable block is uninitialized.");
+        LOG(FATAL) << "mutable block is uninitialized.";
         return false;
     } else if (mutable_block->_tablet_schema.size() != _schema_mapping.size()) 
{
         OLAP_LOG_WARNING("mutable block does not match with schema mapping 
rules. "
@@ -616,7 +616,7 @@ bool RowBlockMerger::_make_heap(const vector<RowBlock*>& 
row_block_arr) {
         element.row_cursor = new(nothrow) RowCursor();
 
         if (element.row_cursor == NULL) {
-            OLAP_LOG_FATAL("failed to malloc RowCursor. [size=%ld]", 
sizeof(RowCursor));
+            LOG(FATAL) << "failed to malloc RowCursor. size=" << 
sizeof(RowCursor);
             return false;
         }
 
@@ -735,8 +735,7 @@ bool SchemaChangeDirectly::process(ColumnData* olap_data, 
SegmentGroup* new_segm
     if (NULL == _row_block_allocator) {
         if (NULL == (_row_block_allocator =
                          new(nothrow) 
RowBlockAllocator(_olap_table->tablet_schema(), 0))) {
-            OLAP_LOG_FATAL("failed to malloc RowBlockAllocator. [size=%ld]",
-                           sizeof(RowBlockAllocator));
+            LOG(FATAL) << "failed to malloc RowBlockAllocator. size=" << 
sizeof(RowBlockAllocator);
             return false;
         }
     }
@@ -877,10 +876,11 @@ bool SchemaChangeDirectly::process(ColumnData* olap_data, 
SegmentGroup* new_segm
     if (config::row_nums_check) {
         if (olap_data->segment_group()->num_rows()
             != new_segment_group->num_rows() + merged_rows() + filted_rows()) {
-            OLAP_LOG_FATAL("fail to check row num! "
-                           "[source_rows=%lu merged_rows=%lu filted_rows=%lu 
new_index_rows=%lu]",
-                           olap_data->segment_group()->num_rows(),
-                           merged_rows(), filted_rows(), 
new_segment_group->num_rows());
+            LOG(FATAL) << "fail to check row num! "
+                       << "source_rows=" << 
olap_data->segment_group()->num_rows()
+                       << ", merged_rows=" << merged_rows()
+                       << ", filted_rows=" << filted_rows()
+                       << ", new_index_rows=" << new_segment_group->num_rows();
             result = false;
         }
     } else {
@@ -921,8 +921,7 @@ bool SchemaChangeWithSorting::process(ColumnData* 
olap_data, SegmentGroup* new_s
     if (NULL == _row_block_allocator) {
         if (NULL == (_row_block_allocator = new(nothrow) RowBlockAllocator(
                         _olap_table->tablet_schema(), _memory_limitation))) {
-            OLAP_LOG_FATAL("failed to malloc RowBlockAllocator. [size=%ld]",
-                           sizeof(RowBlockAllocator));
+            LOG(FATAL) << "failed to malloc RowBlockAllocator. size=" << 
sizeof(RowBlockAllocator);
             return false;
         }
     }
@@ -1790,8 +1789,7 @@ OLAPStatus SchemaChangeHandler::schema_version_convert(
     }
 
     if (NULL == sc_procedure) {
-        OLAP_LOG_FATAL("failed to malloc SchemaChange. [size=%ld]",
-                       sizeof(SchemaChangeWithSorting));
+        LOG(FATAL) << "failed to malloc SchemaChange. size=" << 
sizeof(SchemaChangeWithSorting);
         return OLAP_ERR_MALLOC_ERROR;
     }
 
@@ -1825,7 +1823,7 @@ OLAPStatus SchemaChangeHandler::schema_version_convert(
         }
 
         if (NULL == new_segment_group) {
-            OLAP_LOG_FATAL("failed to malloc SegmentGroup. [size=%ld]", 
sizeof(SegmentGroup));
+            LOG(FATAL) << "failed to malloc SegmentGroup. size=" << 
sizeof(SegmentGroup);
             res = OLAP_ERR_MALLOC_ERROR;
             goto SCHEMA_VERSION_CONVERT_ERR;
         }
@@ -1938,15 +1936,15 @@ OLAPStatus 
SchemaChangeHandler::_save_schema_change_info(
     // save new olap table header :只有一个父ref table
     res = new_olap_table->save_header();
     if (res != OLAP_SUCCESS) {
-        OLAP_LOG_FATAL("fail to save new table header. [res=%d table='%s']",
-                       res, new_olap_table->full_name().c_str());
+        LOG(FATAL) << "fail to save new table header. res=" << res
+                   << ", tablet=" << new_olap_table->full_name();
         return res;
     }
 
     res = ref_olap_table->save_header();
     if (res != OLAP_SUCCESS) {
-        OLAP_LOG_FATAL("fail to save ref table header. [res=%d table='%s']",
-                       res, ref_olap_table->full_name().c_str());
+        LOG(FATAL) << "fail to save ref table header. res=" << res
+                   << ", tablet=" << ref_olap_table->full_name().c_str();
         return res;
     }
 
@@ -2124,8 +2122,8 @@ OLAPStatus 
SchemaChangeHandler::_alter_table(SchemaChangeParams* sc_params) {
 
         // 保存header
         if (OLAP_SUCCESS != sc_params->new_olap_table->save_header()) {
-            OLAP_LOG_FATAL("fail to save header. [res=%d table='%s']",
-                           res, 
sc_params->new_olap_table->full_name().c_str());
+            LOG(FATAL) << "fail to save header. res=" << res
+                       << ", tablet=" << 
sc_params->new_olap_table->full_name();
         }
 
         // XXX: 此处需要验证ref_olap_data_arr中最后一个版本是否与new_olap_table的header中记录的最
@@ -2143,8 +2141,7 @@ OLAPStatus 
SchemaChangeHandler::_alter_table(SchemaChangeParams* sc_params) {
 
         // 保存header
         if (OLAP_SUCCESS != sc_params->ref_olap_table->save_header()) {
-            OLAP_LOG_FATAL("failed to save header. [table='%s']",
-                           sc_params->new_olap_table->full_name().c_str());
+            LOG(FATAL) << "failed to save header. tablet=" << 
sc_params->new_olap_table->full_name();
         }
 
         sc_params->new_olap_table->release_header_lock();
diff --git a/be/src/olap/segment_reader.cpp b/be/src/olap/segment_reader.cpp
index 2a50306f..f4b73baf 100644
--- a/be/src/olap/segment_reader.cpp
+++ b/be/src/olap/segment_reader.cpp
@@ -672,7 +672,7 @@ OLAPStatus SegmentReader::_load_index(bool is_using_cache) {
                         key, stream_buffer, stream_length, 
&_delete_cached_index_stream);
                 if (NULL == _cache_handle[cache_handle_index]) {
                     // 这里可能是cache insert中的malloc失败了, 先返回成功
-                    OLAP_LOG_FATAL("fail to insert lru cache.");
+                    LOG(FATAL) << "fail to insert lru cache.";
                 }
             }
         }
diff --git a/be/src/olap/utils.cpp b/be/src/olap/utils.cpp
index 36d3fd4e..80b6ddfa 100644
--- a/be/src/olap/utils.cpp
+++ b/be/src/olap/utils.cpp
@@ -47,7 +47,7 @@ using std::vector;
     do {\
         int lock_ret = 0;\
         if (0 != (lock_ret = pthread_mutex_init(lockptr, param))) {\
-            OLAP_LOG_FATAL("fail to init mutex. [lock_ret=%d err='%m']", 
lock_ret);\
+            LOG(FATAL) << "fail to init mutex. err=" << strerror(lock_ret); \
         }\
     } while (0)
 
@@ -55,7 +55,7 @@ using std::vector;
     do {\
         int lock_ret = 0;\
         if (0 != (lock_ret = pthread_mutex_destroy(lockptr))) {\
-            OLAP_LOG_FATAL("fail to destroy mutex. [lock_ret=%d err='%m']", 
lock_ret);\
+            LOG(FATAL) << "fail to destroy mutex. err=" << strerror(lock_ret); 
\
         }\
     } while (0)
 
@@ -63,7 +63,7 @@ using std::vector;
     do {\
         int lock_ret = 0;\
         if (0 != (lock_ret = pthread_mutex_lock(lockptr))) {\
-            OLAP_LOG_FATAL("fail to lock mutex. [lock_ret=%d err='%m']", 
lock_ret);\
+            LOG(FATAL) << "fail to lock mutex. err=" << strerror(lock_ret); \
         }\
     } while (0)
 
@@ -71,7 +71,7 @@ using std::vector;
     do {\
         int lock_ret = 0;\
         if (0 != (lock_ret = pthread_mutex_unlock(lockptr))) {\
-            OLAP_LOG_FATAL("fail to unlock mutex. [lock_ret=%d err='%m']", 
lock_ret);\
+            LOG(FATAL) << "fail to unlock mutex. err=" << strerror(lock_ret); \
         }\
     } while (0)
 
@@ -79,7 +79,7 @@ using std::vector;
     do {\
         int lock_ret = 0;\
         if (0 != (lock_ret = pthread_rwlock_init(lockptr, param))) {\
-            OLAP_LOG_FATAL("fail to init rwlock. [lock_ret=%d err='%m']", 
lock_ret);\
+            LOG(FATAL) << "fail to init rwlock. err=" << strerror(lock_ret); \
         }\
     } while (0)
 
@@ -87,7 +87,7 @@ using std::vector;
     do {\
         int lock_ret = 0;\
         if (0 != (lock_ret = pthread_rwlock_destroy(lockptr))) {\
-            OLAP_LOG_FATAL("fail to destroy rwlock. [lock_ret=%d err='%m']", 
lock_ret);\
+            LOG(FATAL) << "fail to destroy rwlock. err=" << 
strerror(lock_ret); \
         }\
     } while (0)
 
@@ -95,7 +95,7 @@ using std::vector;
     do {\
         int lock_ret = 0;\
         if (0 != (lock_ret = pthread_rwlock_rdlock(lockptr))) {\
-            OLAP_LOG_FATAL("fail to lock reader lock. [lock_ret=%d err='%m']", 
lock_ret);\
+            LOG(FATAL) << "fail to lock reader lock. err=" << 
strerror(lock_ret); \
         }\
     } while (0)
 
@@ -103,7 +103,7 @@ using std::vector;
     do {\
         int lock_ret = 0;\
         if (0 != (lock_ret = pthread_rwlock_wrlock(lockptr))) {\
-            OLAP_LOG_FATAL("fail to lock writer lock. [lock_ret=%d err='%m']", 
lock_ret);\
+            LOG(FATAL) << "fail to lock writer lock. err=" << 
strerror(lock_ret); \
         }\
     } while (0)
 
@@ -111,7 +111,7 @@ using std::vector;
     do {\
         int lock_ret = 0;\
         if (0 != (lock_ret = pthread_rwlock_unlock(lockptr))) {\
-            OLAP_LOG_FATAL("fail to unlock rwlock. [lock_ret=%d err='%m']", 
lock_ret);\
+            LOG(FATAL) << "fail to unlock rwlock. err=" << strerror(lock_ret); 
\
         }\
     } while (0)
 
@@ -119,7 +119,7 @@ using std::vector;
     do {\
         int cond_ret = 0;\
         if (0 != (cond_ret = pthread_cond_init(condptr, param))) {\
-            OLAP_LOG_FATAL("fail to init cond. [cond_ret=%d err='%m']", 
cond_ret);\
+            LOG(FATAL) << "fail to init cond. err=" << strerror(cond_ret); \
         }\
     } while (0)
 
@@ -127,7 +127,7 @@ using std::vector;
     do {\
         int cond_ret = 0;\
         if (0 != (cond_ret = pthread_cond_destroy(condptr))) {\
-            OLAP_LOG_FATAL("fail to destroy cond. [cond_ret=%d err='%m']", 
cond_ret);\
+            LOG(FATAL) << "fail to destroy cond. err=" << strerror(cond_ret); \
         }\
     } while (0)
 
@@ -135,7 +135,7 @@ using std::vector;
     do {\
         int cond_ret = 0;\
         if (0 != (cond_ret = pthread_cond_wait(condptr, lockptr))) {\
-            OLAP_LOG_FATAL("fail to wait cond. [cond_ret=%d err='%m']", 
cond_ret);\
+            LOG(FATAL) << "fail to wait cond. err=" << strerror(cond_ret); \
         }\
     } while (0)
 
@@ -148,9 +148,9 @@ using std::vector;
         int cond_ret = 0;\
         cond_ret = pthread_cond_timedwait(condptr, lockptr, &outtime);\
         if (0 != cond_ret && ETIMEDOUT != cond_ret) {\
-            OLAP_LOG_FATAL("fail to timewait cond. "\
-                           "[cond_ret=%d err='%m' outtime.tv_sec=%d 
outtime.tv_nsec=%ld]",\
-                           cond_ret, outtime.tv_sec, outtime.tv_nsec);  \
+            LOG(FATAL) << "fail to timewait cond. err=" << strerror(cond_ret) \
+                       << ", outtime.tv_sec=" << outtime.tv_sec \
+                       << ", outtime.tv_nsec=" << outtime.tv_nsec; \
         }\
     } while (0)
 
@@ -158,7 +158,7 @@ using std::vector;
     do {\
         int cond_ret = 0;\
         if (0 != (cond_ret = pthread_cond_signal(condptr))) {\
-            OLAP_LOG_FATAL("fail to signal cond. [cond_ret=%d err='%m']", 
cond_ret);\
+            LOG(FATAL) << "fail to signal cond. err=" << strerror(cond_ret); \
         }\
     } while (0)
 
@@ -166,7 +166,7 @@ using std::vector;
     do {\
         int cond_ret = 0;\
         if (0 != (cond_ret = pthread_cond_broadcast(condptr))) {\
-            OLAP_LOG_FATAL("fail to broadcast cond. [cond_ret=%d err='%m']", 
cond_ret);\
+            LOG(FATAL) << "fail to broadcast cond. err=" << 
strerror(cond_ret); \
         }\
     } while (0)
 
@@ -1204,9 +1204,9 @@ void Condition::wait_for_seconds(uint32_t seconds) {
     int cond_ret = 0;
     cond_ret = pthread_cond_timedwait(&_cond, _mutex.getlock(), &outtime);
     if (0 != cond_ret && ETIMEDOUT != cond_ret) {
-        OLAP_LOG_FATAL("fail to timewait cond. "
-                       "[cond_ret=%d err='%m' outtime.tv_sec=%d 
outtime.tv_nsec=%ld]",
-                       cond_ret, outtime.tv_sec, outtime.tv_nsec); 
+        LOG(FATAL) << "fail to timewait cond. err=" << strerror(cond_ret)
+                   << ", outtime.tv_sec=" << outtime.tv_sec
+                   << ", outtime.tv_nsec=" << outtime.tv_nsec;
     }
 }
 
diff --git a/be/src/olap/utils.h b/be/src/olap/utils.h
index ec2e0068..408a4b63 100644
--- a/be/src/olap/utils.h
+++ b/be/src/olap/utils.h
@@ -518,13 +518,11 @@ bool valid_datetime(const std::string& value_str);
 #define OLAP_LOG_TRACE(fmt, arg...)  OLAP_VLOG_WRITE(20, fmt, ##arg)
 
 #define OLAP_LOG_WARNING(fmt, arg...) OLAP_LOG_WRITE(WARNING, fmt, ##arg)
-#define OLAP_LOG_FATAL(fmt, arg...) OLAP_LOG_WRITE(ERROR, fmt, ##arg)
 
 #define OLAP_LOG_DEBUG_SOCK(fmt, arg...) OLAP_LOG_WRITE(INFO, fmt, ##arg)
 #define OLAP_LOG_TRACE_SOCK(fmt, arg...) OLAP_LOG_WRITE(INFO, fmt, ##arg)
 #define OLAP_LOG_NOTICE_DIRECT_SOCK(fmt, arg...) OLAP_LOG_WRITE(INFO, fmt, 
##arg)
 #define OLAP_LOG_WARNING_SOCK(fmt, arg...) OLAP_LOG_WRITE(WARNING, fmt, ##arg)
-#define OLAP_LOG_FATAL_SOCK(fmt, arg...) OLAP_LOG_WRITE(ERROR, fmt, ##arg)
 #define OLAP_LOG_SETBASIC(type, fmt, arg...)
 
 // Util used to get string name of thrift enum item


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to