Skip to content

Commit e9b3167

Browse files
committed
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.
1 parent 05841cd commit e9b3167

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/couch_scanner/src/couch_scanner_util.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@ format_db(Db) when is_list(Db) ->
269269
format_db(list_to_binary(Db));
270270
format_db(Db) when is_tuple(Db) ->
271271
format_db(couch_db:name(Db));
272-
format_db(<<"shards/", B:8/binary, "-", E:8/binary, "/", Rest/binary>>) ->
272+
format_db(<<"shards/", _:8/binary, "-", _:8/binary, "/", Rest/binary>>) ->
273273
[Db, _] = binary:split(Rest, <<".">>),
274-
<<Db/binary, "/", B/binary, "-", E/binary>>;
274+
Db;
275275
format_db(<<Db/binary>>) ->
276276
Db.
277277

@@ -354,7 +354,7 @@ log_format_test() ->
354354
?assertEqual("mod db:x ", tlog(#{db => <<"x">>})),
355355
?assertEqual("mod s:y f:z db:x ", tlog(#{db => "x", sid => y, fn => z})),
356356
Shard = <<"shards/80000000-ffffffff/db.1712291766">>,
357-
?assertEqual("mod db:db/80000000-ffffffff ", tlog(#{db => Shard})).
357+
?assertEqual("mod db:db ", tlog(#{db => Shard})).
358358

359359
tlog(Meta) ->
360360
{Fmt, Args} = log_format_meta(mod, Meta),

0 commit comments

Comments
 (0)