]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
test/osd: Improve test logging with OSD identification 68738/head
authorAlex Ainscow <aainscow@uk.ibm.com>
Sun, 3 May 2026 16:46:00 +0000 (17:46 +0100)
committerAlex Ainscow <aainscow@uk.ibm.com>
Mon, 8 Jun 2026 12:06:01 +0000 (13:06 +0100)
commitc7bbe58ae7a89b6a8db818fe704042c80c6b5682
tree9403bf07237721c59a07f1f3f0ccbdca6f891bc0
parent0bb56bbda4eca831820df54d9616be5f52aab277
test/osd: Improve test logging with OSD identification

Modified the logging system to show which OSD is executing in test logs,
making it easier to debug multi-OSD test scenarios.

Changes:
- Added Log::set_prefix_hook() to allow tests to customize log prefixes
- Modified Log::_flush() to use prefix_hook when set, replacing thread IDs
- Added EventLoop::get_log_prefix() to return 'osd.X' or 'harness' based on context
- Updated EventLoop to track current_executing_osd during event execution
- Simplified PGBackendTestFixture to use NoDoutPrefix directly
- Removed redundant 'shard X:' prefix from ShardDpp (info already in PG identifier)
- Removed verbose console output from EventLoop (now redundant with OSD prefixes)
- Converted EventLoop message scheduling to use dout at level 20

Benefits:
- Test logs now show 'osd.X' instead of thread IDs during event execution
- Shows 'harness' for test setup/teardown code outside events
- Message scheduling visible in logs at debug level 20
- Makes multi-OSD test scenarios much easier to follow and debug
- No changes to production logging code

AI assisted code, with careful human review and checking.

AI-assisted-by: IBM Bob IDE:Claude Sonnet (Anthropic)
Signed-off-by: Alex Ainscow <aainscow@uk.ibm.com>
src/log/Log.cc
src/log/Log.h
src/test/osd/ECPeeringTestFixture.cc
src/test/osd/EventLoop.h
src/test/osd/PGBackendTestFixture.h