This is an automated email from the ASF dual-hosted git repository. vatamane pushed a commit to branch scanner-improvements in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 3f7c80794bd12cb9a34fc1f5ecdc9149e1df9ed9 Author: Nick Vatamaniuc <[email protected]> AuthorDate: Thu Feb 6 12:47:28 2025 -0500 Improve scanner log reporting Emit just the db name in the `db:...` field and skip the range. After processing scan results for months I never once needed or used the range, it just adds extra noise, so let's remove it. --- src/couch_scanner/src/couch_scanner_util.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/couch_scanner/src/couch_scanner_util.erl b/src/couch_scanner/src/couch_scanner_util.erl index 2caafaa5b..ff4edafd3 100644 --- a/src/couch_scanner/src/couch_scanner_util.erl +++ b/src/couch_scanner/src/couch_scanner_util.erl @@ -269,9 +269,9 @@ format_db(Db) when is_list(Db) -> format_db(list_to_binary(Db)); format_db(Db) when is_tuple(Db) -> format_db(couch_db:name(Db)); -format_db(<<"shards/", B:8/binary, "-", E:8/binary, "/", Rest/binary>>) -> +format_db(<<"shards/", _:8/binary, "-", _:8/binary, "/", Rest/binary>>) -> [Db, _] = binary:split(Rest, <<".">>), - <<Db/binary, "/", B/binary, "-", E/binary>>; + Db; format_db(<<Db/binary>>) -> Db. @@ -354,7 +354,7 @@ log_format_test() -> ?assertEqual("mod db:x ", tlog(#{db => <<"x">>})), ?assertEqual("mod s:y f:z db:x ", tlog(#{db => "x", sid => y, fn => z})), Shard = <<"shards/80000000-ffffffff/db.1712291766">>, - ?assertEqual("mod db:db/80000000-ffffffff ", tlog(#{db => Shard})). + ?assertEqual("mod db:db ", tlog(#{db => Shard})). tlog(Meta) -> {Fmt, Args} = log_format_meta(mod, Meta),
