Skip to content

Commit 25ef5db

Browse files
committed
feat(logging): Use spdlog to replace simple_logger and screen_logger
1 parent 581a811 commit 25ef5db

134 files changed

Lines changed: 340 additions & 1227 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.licenserc.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ header:
165165
- 'src/runtime/global_config.h'
166166
- 'src/common/gpid.h'
167167
- 'src/runtime/rpc/group_address.h'
168-
- 'src/utils/logging_provider.h'
169168
- 'src/runtime/rpc/message_parser.h'
170169
- 'src/runtime/rpc/network.h'
171170
- 'src/runtime/rpc/rpc_address.cpp'
@@ -617,8 +616,6 @@ header:
617616
- 'src/utils/lockp.std.h'
618617
- 'src/utils/logging.cpp'
619618
- 'src/utils/shared_io_service.h'
620-
- 'src/utils/simple_logger.cpp'
621-
- 'src/utils/simple_logger.h'
622619
- 'src/utils/strings.cpp'
623620
- 'src/utils/test/CMakeLists.txt'
624621
- 'src/utils/test/clear.sh'
@@ -637,7 +634,6 @@ header:
637634
- 'src/utils/test/join_point_test.cpp'
638635
- 'src/utils/test/json_helper_test.cpp'
639636
- 'src/utils/test/lock.std.cpp'
640-
- 'src/utils/test/logger.cpp'
641637
- 'src/utils/test/logging.cpp'
642638
- 'src/utils/test/output_utils_test.cpp'
643639
- 'src/utils/test/priority_queue.cpp'

cmake_modules/BaseFunctions.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ function(dsn_setup_compiler_flags)
216216
if(${BUILD_TEST})
217217
add_definitions(-DMOCK_TEST)
218218
endif()
219+
# Use external fmt library instead of spdlog bundled.
220+
add_definitions(-DSPDLOG_FMT_EXTERNAL)
221+
# Define the compile time lowest log level to be active.
222+
add_definitions(-DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_DEBUG)
223+
# Compile with -fno-exceptions. Call abort() on any spdlog exceptions.
224+
add_definitions(-DSPDLOG_NO_EXCEPTIONS=ON)
219225

220226
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -gdwarf-4" CACHE STRING "" FORCE)
221227

src/aio/test/config.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ enable_default_app_mimic = true
4242
tool = nativerun
4343
pause_on_start = false
4444
logging_start_level = LOG_LEVEL_DEBUG
45-
logging_factory_name = dsn::tools::simple_logger
4645

4746
[aio_test]
4847
op_buffer_size = 12

src/base/test/config.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ tool = nativerun
3636
pause_on_start = false
3737

3838
logging_start_level = LOG_LEVEL_DEBUG
39-
logging_factory_name = dsn::tools::simple_logger
40-
;logging_factory_name = dsn::tools::screen_logger
4139
logging_flush_on_exit = true
4240

4341
enable_default_app_mimic = true

src/block_service/test/config-test.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ pools = THREAD_POOL_DEFAULT,THREAD_POOL_BLOCK_SERVICE
3737
tool = nativerun
3838
pause_on_start = false
3939
logging_start_level = LOG_LEVEL_DEBUG
40-
logging_factory_name = dsn::tools::simple_logger
4140

4241
[tools.simple_logger]
4342
fast_flush = true

src/client/test/config.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ tool = nativerun
3636
pause_on_start = false
3737

3838
logging_start_level = LOG_LEVEL_INFO
39-
logging_factory_name = dsn::tools::simple_logger
40-
;logging_factory_name = dsn::tools::screen_logger
4139
logging_flush_on_exit = false
4240

4341
enable_default_app_mimic = true

src/client_lib/pegasus_client_impl.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
* under the License.
1818
*/
1919

20-
#include <fmt/core.h>
2120
#include <pegasus/error.h>
2221
#include <algorithm>
2322
#include <chrono>

src/common/test/config-test.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ cli_local = false
4747
cli_remote = false
4848

4949
logging_start_level = LOG_LEVEL_DEBUG
50-
logging_factory_name = dsn::tools::simple_logger
51-
5250

5351
[tools.simple_logger]
5452
fast_flush = true

src/failure_detector/test/config-test.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ tool = nativerun
7171
pause_on_start = false
7272

7373
logging_start_level = LOG_LEVEL_DEBUG
74-
logging_factory_name = dsn::tools::simple_logger
7574

7675

7776
[tools.simple_logger]

src/failure_detector/test/config-whitelist-test-failed.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ tool = nativerun
7272
pause_on_start = false
7373

7474
logging_start_level = LOG_LEVEL_DEBUG
75-
logging_factory_name = dsn::tools::simple_logger
7675

7776

7877
[tools.simple_logger]

0 commit comments

Comments
 (0)