Skip to content

Instantly share code, notes, and snippets.

@BillyDonahue
Last active June 26, 2020 18:08
Show Gist options
  • Save BillyDonahue/3279d262a89f9ee7047da0b4548b5df0 to your computer and use it in GitHub Desktop.
Save BillyDonahue/3279d262a89f9ee7047da0b4548b5df0 to your computer and use it in GitHub Desktop.
8-digit LOGV2 identifiers git grep -En 'LOGV2.*\(\s*[0-9]{8}' >hits.txt
[
{
"file": "src/mongo/db/auth/sasl_mechanism_registry.cpp",
"line": 192,
"data": " LOGV2_ERROR(47429001,",
"blame": "b'817a7f19511 (Mark Benvenuto 2020-04-20 14:34:56 -0400 192) LOGV2_ERROR(47429001,\\n'"
},
{
"file": "src/mongo/db/catalog/index_catalog_entry_impl.cpp",
"line": 356,
"data": " LOGV2_DEBUG(47187005,",
"blame": "b'3566db153ea (Daniel Gottlieb 2020-04-24 09:59:05 -0400 356) LOGV2_DEBUG(47187005,\\n'"
},
{
"file": "src/mongo/db/catalog/index_consistency.cpp",
"line": 216,
"data": " LOGV2(46666002, \"[validate](record) {hash_num}\", \"hash_num\"_attr = hash);",
"blame": "b'86d40fda4d1 (Dianna Hohensee 2020-03-05 19:01:26 -0500 216) LOGV2(46666002, \"[validate](record) {hash_num}\", \"hash_num\"_attr = hash);\\n'"
},
{
"file": "src/mongo/db/catalog/index_consistency.cpp",
"line": 260,
"data": " LOGV2(46666003, \"[validate](index) {hash_num}\", \"hash_num\"_attr = hash);",
"blame": "b'86d40fda4d1 (Dianna Hohensee 2020-03-05 19:01:26 -0500 260) LOGV2(46666003, \"[validate](index) {hash_num}\", \"hash_num\"_attr = hash);\\n'"
},
{
"file": "src/mongo/db/catalog/validate_adaptor.cpp",
"line": 78,
"data": " LOGV2(46666001, \"[validate]\", \"recordId\"_attr = recordId, \"recordData\"_attr = recordBson);",
"blame": "b'0f3ea400ef0 (Eric Milkie 2020-04-22 08:33:42 -0400 78) LOGV2(46666001, \"[validate]\", \"recordId\"_attr = recordId, \"recordData\"_attr = recordBson);\\n'"
},
{
"file": "src/mongo/db/commands/killoperations_common.h",
"line": 67,
"data": " LOGV2(46156011, \"Attempting to kill operation\", \"operationKey\"_attr = opKey);",
"blame": "b'f2ec5e85fdc (Cheahuychou Mao 2020-03-13 13:04:55 -0400 67) LOGV2(46156011, \"Attempting to kill operation\", \"operationKey\"_attr = opKey);\\n'"
},
{
"file": "src/mongo/db/query/sbe_stage_builder_index_scan.cpp",
"line": 219,
"data": " LOGV2_DEBUG(47429006,",
"blame": "b'e3948d4d881 (Martin Neupauer 2020-06-11 08:07:39 +0100 219) LOGV2_DEBUG(47429006,\\n'"
},
{
"file": "src/mongo/db/repl/storage_interface_impl.cpp",
"line": 1122,
"data": " LOGV2(47959000,",
"blame": "b'dcc42b3db40 (Dianna Hohensee 2020-05-05 13:33:48 -0400 1122) LOGV2(47959000,\\n'"
},
{
"file": "src/mongo/db/s/collection_sharding_runtime.cpp",
"line": 219,
"data": " LOGV2_DEBUG(47985030,",
"blame": "b'f7c2b0c472b (Tommaso Tocci 2020-05-25 13:34:23 +0200 219) LOGV2_DEBUG(47985030,\\n'"
},
{
"file": "src/mongo/db/s/migration_util.cpp",
"line": 790,
"data": " LOGV2_DEBUG(47985010, 2, \"Starting migration coordinator stepup recovery\");",
"blame": "b'f7c2b0c472b (Tommaso Tocci 2020-05-25 13:34:23 +0200 790) LOGV2_DEBUG(47985010, 2, \"Starting migration coordinator stepup recovery\");\\n'"
},
{
"file": "src/mongo/db/s/migration_util.cpp",
"line": 800,
"data": " LOGV2_DEBUG(47985011,",
"blame": "b'f7c2b0c472b (Tommaso Tocci 2020-05-25 13:34:23 +0200 800) LOGV2_DEBUG(47985011,\\n'"
},
{
"file": "src/mongo/db/s/migration_util.cpp",
"line": 829,
"data": " LOGV2_WARNING(47985012,",
"blame": "b'f7c2b0c472b (Tommaso Tocci 2020-05-25 13:34:23 +0200 829) LOGV2_WARNING(47985012,\\n'"
},
{
"file": "src/mongo/db/s/migration_util.cpp",
"line": 840,
"data": " LOGV2_DEBUG(47985013,",
"blame": "b'f7c2b0c472b (Tommaso Tocci 2020-05-25 13:34:23 +0200 840) LOGV2_DEBUG(47985013,\\n'"
},
{
"file": "src/mongo/db/s/migration_util.cpp",
"line": 847,
"data": " LOGV2_DEBUG(47985001, 2, \"Starting migration recovery\", \"namespace\"_attr = nss);",
"blame": "b'f7c2b0c472b (Tommaso Tocci 2020-05-25 13:34:23 +0200 847) LOGV2_DEBUG(47985001, 2, \"Starting migration recovery\", \"namespace\"_attr = nss);\\n'"
},
{
"file": "src/mongo/db/s/migration_util.cpp",
"line": 856,
"data": " LOGV2_DEBUG(47985002,",
"blame": "b'f7c2b0c472b (Tommaso Tocci 2020-05-25 13:34:23 +0200 856) LOGV2_DEBUG(47985002,\\n'"
},
{
"file": "src/mongo/db/s/migration_util.cpp",
"line": 915,
"data": " LOGV2(47985003,",
"blame": "b'f7c2b0c472b (Tommaso Tocci 2020-05-25 13:34:23 +0200 915) LOGV2(47985003,\\n'"
},
{
"file": "src/mongo/db/s/migration_util.cpp",
"line": 923,
"data": " LOGV2(47985004,",
"blame": "b'f7c2b0c472b (Tommaso Tocci 2020-05-25 13:34:23 +0200 923) LOGV2(47985004,\\n'"
},
{
"file": "src/mongo/db/startup_warnings_common.cpp",
"line": 54,
"data": " LOGV2_WARNING(47187001, \"{str}\", \"str\"_attr = str);",
"blame": "b'905011e695e (Mark Benvenuto 2020-04-10 12:06:44 -0400 54) LOGV2_WARNING(47187001, \"{str}\", \"str\"_attr = str);\\n'"
},
{
"file": "src/mongo/db/startup_warnings_common.cpp",
"line": 62,
"data": " LOGV2_WARNING(47187002, \"{str}\", \"str\"_attr = str);",
"blame": "b'905011e695e (Mark Benvenuto 2020-04-10 12:06:44 -0400 62) LOGV2_WARNING(47187002, \"{str}\", \"str\"_attr = str);\\n'"
},
{
"file": "src/mongo/db/startup_warnings_common.cpp",
"line": 78,
"data": " LOGV2_WARNING(47187003, \"{str}\", \"str\"_attr = str);",
"blame": "b'905011e695e (Mark Benvenuto 2020-04-10 12:06:44 -0400 78) LOGV2_WARNING(47187003, \"{str}\", \"str\"_attr = str);\\n'"
},
{
"file": "src/mongo/db/storage/control/journal_flusher.cpp",
"line": 78,
"data": " LOGV2_DEBUG(45847001, 1, \"starting {name} thread\", \"name\"_attr = name());",
"blame": "b'6af5a08234f (Dianna Hohensee 2020-03-13 16:34:30 -0400 78) LOGV2_DEBUG(45847001, 1, \"starting {name} thread\", \"name\"_attr = name());\\n'"
},
{
"file": "src/mongo/db/storage/control/journal_flusher.cpp",
"line": 134,
"data": " LOGV2_DEBUG(45847002, 1, \"stopping {name} thread\", \"name\"_attr = name());",
"blame": "b'6af5a08234f (Dianna Hohensee 2020-03-13 16:34:30 -0400 134) LOGV2_DEBUG(45847002, 1, \"stopping {name} thread\", \"name\"_attr = name());\\n'"
},
{
"file": "src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp",
"line": 650,
"data": " LOGV2(47959011, \"Recovery complete\", \"duration\"_attr = Date_t::now() - start);",
"blame": "b'eae377f7f23 (Daniel Gottlieb 2020-05-20 14:06:45 -0400 650) LOGV2(47959011, \"Recovery complete\", \"duration\"_attr = Date_t::now() - start);\\n'"
},
{
"file": "src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp",
"line": 659,
"data": " LOGV2(47959010,",
"blame": "b'eae377f7f23 (Daniel Gottlieb 2020-05-20 14:06:45 -0400 659) LOGV2(47959010,\\n'"
},
{
"file": "src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp",
"line": 675,
"data": " LOGV2(47959008, \"Journal files removed\", \"duration\"_attr = Date_t::now() - start);",
"blame": "b'eae377f7f23 (Daniel Gottlieb 2020-05-20 14:06:45 -0400 675) LOGV2(47959008, \"Journal files removed\", \"duration\"_attr = Date_t::now() - start);\\n'"
},
{
"file": "src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp",
"line": 685,
"data": " LOGV2(47959006, \"WiredTiger opened\", \"duration\"_attr = Date_t::now() - startTime);",
"blame": "b'eae377f7f23 (Daniel Gottlieb 2020-05-20 14:06:45 -0400 685) LOGV2(47959006, \"WiredTiger opened\", \"duration\"_attr = Date_t::now() - startTime);\\n'"
},
{
"file": "src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp",
"line": 931,
"data": " LOGV2(47959005, \"WiredTiger closed\", \"duration\"_attr = Date_t::now() - startTime);",
"blame": "b'eae377f7f23 (Daniel Gottlieb 2020-05-20 14:06:45 -0400 931) LOGV2(47959005, \"WiredTiger closed\", \"duration\"_attr = Date_t::now() - startTime);\\n'"
},
{
"file": "src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp",
"line": 936,
"data": " LOGV2(47959004, \"WiredTiger re-opened\", \"duration\"_attr = Date_t::now() - startTime);",
"blame": "b'eae377f7f23 (Daniel Gottlieb 2020-05-20 14:06:45 -0400 936) LOGV2(47959004, \"WiredTiger re-opened\", \"duration\"_attr = Date_t::now() - startTime);\\n'"
},
{
"file": "src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp",
"line": 941,
"data": " LOGV2(47959003, \"Reconfigure complete\", \"duration\"_attr = Date_t::now() - startTime);",
"blame": "b'eae377f7f23 (Daniel Gottlieb 2020-05-20 14:06:45 -0400 941) LOGV2(47959003, \"Reconfigure complete\", \"duration\"_attr = Date_t::now() - startTime);\\n'"
},
{
"file": "src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp",
"line": 945,
"data": " LOGV2(47959002, \"Closing WiredTiger\", \"closeConfig\"_attr = closeConfig);",
"blame": "b'eae377f7f23 (Daniel Gottlieb 2020-05-20 14:06:45 -0400 945) LOGV2(47959002, \"Closing WiredTiger\", \"closeConfig\"_attr = closeConfig);\\n'"
},
{
"file": "src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp",
"line": 947,
"data": " LOGV2(47959001, \"WiredTiger closed\", \"duration\"_attr = Date_t::now() - startTime);",
"blame": "b'eae377f7f23 (Daniel Gottlieb 2020-05-20 14:06:45 -0400 947) LOGV2(47959001, \"WiredTiger closed\", \"duration\"_attr = Date_t::now() - startTime);\\n'"
},
{
"file": "src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp",
"line": 1592,
"data": " LOGV2(47959007, \"Salvage complete\", \"duration\"_attr = Date_t::now() - start);",
"blame": "b'eae377f7f23 (Daniel Gottlieb 2020-05-20 14:06:45 -0400 1592) LOGV2(47959007, \"Salvage complete\", \"duration\"_attr = Date_t::now() - start);\\n'"
},
{
"file": "src/mongo/db/ttl.cpp",
"line": 158,
"data": " LOGV2(36841000, \"Shutting down TTL collection monitor thread\");",
"blame": "b'f0cf2ca62b4 (Jamie Heppenstall 2020-04-20 14:05:16 +0000 158) LOGV2(36841000, \"Shutting down TTL collection monitor thread\");\\n'"
},
{
"file": "src/mongo/db/ttl.cpp",
"line": 165,
"data": " LOGV2(36841001, \"Finished shutting down TTL collection monitor thread\");",
"blame": "b'f0cf2ca62b4 (Jamie Heppenstall 2020-04-20 14:05:16 +0000 165) LOGV2(36841001, \"Finished shutting down TTL collection monitor thread\");\\n'"
}
]
#!/usr/bin/env python3
import regex
import sys
import os
import subprocess
import json
data = """
src/mongo/db/auth/sasl_mechanism_registry.cpp:192: LOGV2_ERROR(47429001,
src/mongo/db/catalog/index_catalog_entry_impl.cpp:356: LOGV2_DEBUG(47187005,
src/mongo/db/catalog/index_consistency.cpp:216: LOGV2(46666002, "[validate](record) {hash_num}", "hash_num"_attr = hash);
src/mongo/db/catalog/index_consistency.cpp:260: LOGV2(46666003, "[validate](index) {hash_num}", "hash_num"_attr = hash);
src/mongo/db/catalog/validate_adaptor.cpp:78: LOGV2(46666001, "[validate]", "recordId"_attr = recordId, "recordData"_attr = recordBson);
src/mongo/db/commands/killoperations_common.h:67: LOGV2(46156011, "Attempting to kill operation", "operationKey"_attr = opKey);
src/mongo/db/query/sbe_stage_builder_index_scan.cpp:219: LOGV2_DEBUG(47429006,
src/mongo/db/repl/storage_interface_impl.cpp:1122: LOGV2(47959000,
src/mongo/db/s/collection_sharding_runtime.cpp:219: LOGV2_DEBUG(47985030,
src/mongo/db/s/migration_util.cpp:790: LOGV2_DEBUG(47985010, 2, "Starting migration coordinator stepup recovery");
src/mongo/db/s/migration_util.cpp:800: LOGV2_DEBUG(47985011,
src/mongo/db/s/migration_util.cpp:829: LOGV2_WARNING(47985012,
src/mongo/db/s/migration_util.cpp:840: LOGV2_DEBUG(47985013,
src/mongo/db/s/migration_util.cpp:847: LOGV2_DEBUG(47985001, 2, "Starting migration recovery", "namespace"_attr = nss);
src/mongo/db/s/migration_util.cpp:856: LOGV2_DEBUG(47985002,
src/mongo/db/s/migration_util.cpp:915: LOGV2(47985003,
src/mongo/db/s/migration_util.cpp:923: LOGV2(47985004,
src/mongo/db/startup_warnings_common.cpp:54: LOGV2_WARNING(47187001, "{str}", "str"_attr = str);
src/mongo/db/startup_warnings_common.cpp:62: LOGV2_WARNING(47187002, "{str}", "str"_attr = str);
src/mongo/db/startup_warnings_common.cpp:78: LOGV2_WARNING(47187003, "{str}", "str"_attr = str);
src/mongo/db/storage/control/journal_flusher.cpp:78: LOGV2_DEBUG(45847001, 1, "starting {name} thread", "name"_attr = name());
src/mongo/db/storage/control/journal_flusher.cpp:134: LOGV2_DEBUG(45847002, 1, "stopping {name} thread", "name"_attr = name());
src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:650: LOGV2(47959011, "Recovery complete", "duration"_attr = Date_t::now() - start);
src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:659: LOGV2(47959010,
src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:675: LOGV2(47959008, "Journal files removed", "duration"_attr = Date_t::now() - start);
src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:685: LOGV2(47959006, "WiredTiger opened", "duration"_attr = Date_t::now() - startTime);
src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:931: LOGV2(47959005, "WiredTiger closed", "duration"_attr = Date_t::now() - startTime);
src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:936: LOGV2(47959004, "WiredTiger re-opened", "duration"_attr = Date_t::now() - startTime);
src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:941: LOGV2(47959003, "Reconfigure complete", "duration"_attr = Date_t::now() - startTime);
src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:945: LOGV2(47959002, "Closing WiredTiger", "closeConfig"_attr = closeConfig);
src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:947: LOGV2(47959001, "WiredTiger closed", "duration"_attr = Date_t::now() - startTime);
src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:1592: LOGV2(47959007, "Salvage complete", "duration"_attr = Date_t::now() - start);
src/mongo/db/ttl.cpp:158: LOGV2(36841000, "Shutting down TTL collection monitor thread");
src/mongo/db/ttl.cpp:165: LOGV2(36841001, "Finished shutting down TTL collection monitor thread");
"""
lines = regex.compile(r'\n').split(data)
recs=[]
for m in lines:
if not len(m):
continue
(f,n,c) = regex.compile(r'([^:]*):([^:]*):(.*)').match(m).groups()
blame = str(subprocess.run(['git', 'blame', f'{f}', '-L', f'{n},{n}'], capture_output=True).stdout)
recs.append({
'file': f,
'line': int(n),
'data': c,
'blame': blame,
})
print("{}".format(json.dumps(recs, indent=4)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment