@mongosh/logging 3.2.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,795 +0,0 @@
1
- import redactInfo from 'mongodb-redact';
2
- import { redactURICredentials } from '@mongosh/history';
3
- import type {
4
- MongoshBus,
5
- ApiEventWithArguments,
6
- ApiEvent,
7
- UseEvent,
8
- EvaluateInputEvent,
9
- ShowEvent,
10
- ConnectEvent,
11
- ScriptLoadFileEvent,
12
- StartLoadingCliScriptsEvent,
13
- StartMongoshReplEvent,
14
- GlobalConfigFileLoadEvent,
15
- CryptLibrarySkipEvent,
16
- CryptLibraryFoundEvent,
17
- SnippetsCommandEvent,
18
- SnippetsErrorEvent,
19
- SnippetsFetchIndexErrorEvent,
20
- SnippetsFetchIndexEvent,
21
- SnippetsLoadedEvent,
22
- SnippetsLoadSnippetEvent,
23
- SnippetsNpmDownloadActiveEvent,
24
- SnippetsNpmDownloadFailedEvent,
25
- SnippetsNpmLookupEvent,
26
- SnippetsRunNpmEvent,
27
- SnippetsTransformErrorEvent,
28
- EditorRunEditCommandEvent,
29
- EditorReadVscodeExtensionsDoneEvent,
30
- EditorReadVscodeExtensionsFailedEvent,
31
- FetchingUpdateMetadataEvent,
32
- FetchingUpdateMetadataCompleteEvent,
33
- SessionStartedEvent,
34
- WriteCustomLogEvent,
35
- } from '@mongosh/types';
36
- import { inspect } from 'util';
37
- import type { MongoLogWriter } from 'mongodb-log-writer';
38
- import { mongoLogId } from 'mongodb-log-writer';
39
- import type { MongoshAnalytics } from './analytics-helpers';
40
- import { hookLogger } from '@mongodb-js/devtools-connect';
41
-
42
- /**
43
- * A helper class for keeping track of how often specific events occurred.
44
- */
45
- class MultiSet<T extends Record<string, any>> {
46
- _entries: Map<string, number> = new Map();
47
-
48
- add(entry: T): void {
49
- const key = JSON.stringify(Object.entries(entry).sort());
50
- this._entries.set(key, (this._entries.get(key) ?? 0) + 1);
51
- }
52
-
53
- clear(): void {
54
- this._entries.clear();
55
- }
56
-
57
- *[Symbol.iterator](): Iterator<[T, number]> {
58
- for (const [key, count] of this._entries) {
59
- yield [Object.fromEntries(JSON.parse(key)) as T, count];
60
- }
61
- }
62
- }
63
-
64
- /**
65
- * It transforms a random string into snake case. Snake case is completely
66
- * lowercase and uses '_' to separate words. For example:
67
- *
68
- * This function defines a "word" as a sequence of characters until the next `.` or capital letter.
69
- *
70
- * 'Random String' => 'random_string'
71
- *
72
- * It will also remove any non alphanumeric characters to ensure the string
73
- * is compatible with Segment. For example:
74
- *
75
- * 'Node.js REPL Instantiation' => 'node_js_repl_instantiation'
76
- *
77
- * @param str Any non snake-case formatted string
78
- * @returns The snake-case formatted string
79
- */
80
- export function toSnakeCase(str: string): string {
81
- const matches = str.match(
82
- /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
83
- );
84
- if (!matches) {
85
- return str;
86
- }
87
-
88
- return matches.map((x) => x.toLowerCase()).join('_');
89
- }
90
-
91
- /**
92
- * Connect a MongoshBus instance that emits events to logging and analytics providers.
93
- *
94
- * @param bus A MongoshBus instance
95
- * @param log A MongoLogWriter instance
96
- * @param makeAnalytics A function that returns an analytics provider (or throws otherwise)
97
- */
98
- export function setupLoggerAndTelemetry(
99
- bus: MongoshBus,
100
- log: MongoLogWriter,
101
- analytics: MongoshAnalytics,
102
- userTraits: any,
103
- mongosh_version: string
104
- ): void {
105
- const { logId: session_id } = log;
106
- let userId: string;
107
- let telemetryAnonymousId: string;
108
-
109
- userTraits = { ...userTraits, session_id };
110
-
111
- const trackProperties = {
112
- mongosh_version,
113
- session_id,
114
- };
115
-
116
- const getTelemetryUserIdentity = () => ({
117
- anonymousId: telemetryAnonymousId ?? userId,
118
- });
119
-
120
- // We emit different analytics events for loading files and evaluating scripts
121
- // depending on whether we're already in the REPL or not yet. We store the
122
- // state here so that the places where the events are emitted don't have to
123
- // be aware of this distinction.
124
- let hasStartedMongoshRepl = false;
125
- bus.on('mongosh:start-mongosh-repl', (ev: StartMongoshReplEvent) => {
126
- log.info('MONGOSH', mongoLogId(1_000_000_002), 'repl', 'Started REPL', ev);
127
- hasStartedMongoshRepl = true;
128
- });
129
-
130
- let usesShellOption = false;
131
- bus.on(
132
- 'mongosh:start-loading-cli-scripts',
133
- (event: StartLoadingCliScriptsEvent) => {
134
- log.info(
135
- 'MONGOSH',
136
- mongoLogId(1_000_000_003),
137
- 'repl',
138
- 'Start loading CLI scripts'
139
- );
140
- usesShellOption = event.usesShellOption;
141
- }
142
- );
143
-
144
- bus.on('mongosh:write-custom-log', (event: WriteCustomLogEvent) => {
145
- log[event.method](
146
- 'MONGOSH-SCRIPTS',
147
- mongoLogId(1_000_000_054),
148
- 'custom-log',
149
- event.message,
150
- event.attr,
151
- event.level
152
- );
153
- });
154
-
155
- bus.on('mongosh:connect', function (args: ConnectEvent) {
156
- const { uri, resolved_hostname, ...argsWithoutUriAndHostname } = args;
157
- const connectionUri = uri && redactURICredentials(uri);
158
- const atlasHostname = {
159
- atlas_hostname: args.is_atlas ? resolved_hostname : null,
160
- };
161
- const properties = {
162
- ...trackProperties,
163
- ...argsWithoutUriAndHostname,
164
- ...atlasHostname,
165
- };
166
-
167
- log.info(
168
- 'MONGOSH',
169
- mongoLogId(1_000_000_004),
170
- 'connect',
171
- 'Connecting to server',
172
- {
173
- userId,
174
- telemetryAnonymousId,
175
- connectionUri,
176
- ...properties,
177
- }
178
- );
179
-
180
- analytics.track({
181
- ...getTelemetryUserIdentity(),
182
- event: 'New Connection',
183
- properties,
184
- });
185
- });
186
-
187
- bus.on('mongosh:start-session', function (args: SessionStartedEvent) {
188
- const normalisedTimingsArray = Object.entries(args.timings).map(
189
- ([key, duration]) => {
190
- const snakeCaseKey = toSnakeCase(key);
191
- return [snakeCaseKey, duration];
192
- }
193
- );
194
-
195
- const normalisedTimings = Object.fromEntries(normalisedTimingsArray);
196
- analytics.track({
197
- ...getTelemetryUserIdentity(),
198
- event: 'Startup Time',
199
- properties: {
200
- ...trackProperties,
201
- is_interactive: args.isInteractive,
202
- js_context: args.jsContext,
203
- ...normalisedTimings,
204
- },
205
- });
206
- });
207
-
208
- bus.on(
209
- 'mongosh:new-user',
210
- function (newTelemetryUserIdentity: {
211
- userId: string;
212
- anonymousId: string;
213
- }) {
214
- if (!newTelemetryUserIdentity.anonymousId) {
215
- userId = newTelemetryUserIdentity.userId;
216
- }
217
- telemetryAnonymousId = newTelemetryUserIdentity.anonymousId;
218
- analytics.identify({
219
- anonymousId: newTelemetryUserIdentity.anonymousId,
220
- traits: userTraits,
221
- });
222
- }
223
- );
224
-
225
- bus.on(
226
- 'mongosh:update-user',
227
- function (updatedTelemetryUserIdentity: {
228
- userId: string;
229
- anonymousId?: string;
230
- }) {
231
- if (updatedTelemetryUserIdentity.anonymousId) {
232
- telemetryAnonymousId = updatedTelemetryUserIdentity.anonymousId;
233
- } else {
234
- userId = updatedTelemetryUserIdentity.userId;
235
- }
236
- analytics.identify({
237
- ...getTelemetryUserIdentity(),
238
- traits: userTraits,
239
- });
240
- log.info('MONGOSH', mongoLogId(1_000_000_005), 'config', 'User updated');
241
- }
242
- );
243
-
244
- bus.on('mongosh:error', function (error: Error, context: string) {
245
- const mongoshError = error as {
246
- name: string;
247
- message: string;
248
- code: any;
249
- scope: any;
250
- metadata: any;
251
- };
252
-
253
- if (context === 'fatal') {
254
- log.fatal(
255
- 'MONGOSH',
256
- mongoLogId(1_000_000_006),
257
- context,
258
- `${mongoshError.name}: ${mongoshError.message}`,
259
- error
260
- );
261
- } else {
262
- log.error(
263
- 'MONGOSH',
264
- mongoLogId(1_000_000_006),
265
- context,
266
- `${mongoshError.name}: ${mongoshError.message}`,
267
- error
268
- );
269
- }
270
-
271
- if (error.name.includes('Mongosh')) {
272
- analytics.track({
273
- ...getTelemetryUserIdentity(),
274
- event: 'Error',
275
- properties: {
276
- ...trackProperties,
277
- name: mongoshError.name,
278
- code: mongoshError.code,
279
- scope: mongoshError.scope,
280
- metadata: mongoshError.metadata,
281
- },
282
- });
283
- }
284
- });
285
-
286
- bus.on(
287
- 'mongosh:globalconfig-load',
288
- function (args: GlobalConfigFileLoadEvent) {
289
- log.info(
290
- 'MONGOSH',
291
- mongoLogId(1_000_000_048),
292
- 'config',
293
- 'Loading global configuration file',
294
- args
295
- );
296
- }
297
- );
298
-
299
- bus.on('mongosh:evaluate-input', function (args: EvaluateInputEvent) {
300
- log.info(
301
- 'MONGOSH',
302
- mongoLogId(1_000_000_007),
303
- 'repl',
304
- 'Evaluating input',
305
- args
306
- );
307
- });
308
-
309
- bus.on('mongosh:use', function (args: UseEvent) {
310
- log.info(
311
- 'MONGOSH',
312
- mongoLogId(1_000_000_008),
313
- 'shell-api',
314
- 'Used "use" command',
315
- args
316
- );
317
-
318
- analytics.track({
319
- ...getTelemetryUserIdentity(),
320
- event: 'Use',
321
- properties: {
322
- ...trackProperties,
323
- },
324
- });
325
- });
326
-
327
- bus.on('mongosh:show', function (args: ShowEvent) {
328
- log.info(
329
- 'MONGOSH',
330
- mongoLogId(1_000_000_009),
331
- 'shell-api',
332
- 'Used "show" command',
333
- args
334
- );
335
-
336
- analytics.track({
337
- ...getTelemetryUserIdentity(),
338
- event: 'Show',
339
- properties: {
340
- ...trackProperties,
341
- method: args.method,
342
- },
343
- });
344
- });
345
-
346
- bus.on('mongosh:setCtx', function (args: ApiEventWithArguments) {
347
- log.info(
348
- 'MONGOSH',
349
- mongoLogId(1_000_000_010),
350
- 'shell-api',
351
- 'Initialized context',
352
- args
353
- );
354
- });
355
-
356
- bus.on(
357
- 'mongosh:api-call-with-arguments',
358
- function (args: ApiEventWithArguments) {
359
- // TODO: redactInfo cannot handle circular or otherwise nontrivial input
360
- let arg;
361
- try {
362
- arg = JSON.parse(JSON.stringify(args));
363
- } catch {
364
- arg = { _inspected: inspect(args) };
365
- }
366
- log.info(
367
- 'MONGOSH',
368
- mongoLogId(1_000_000_011),
369
- 'shell-api',
370
- 'Performed API call',
371
- redactInfo(arg)
372
- );
373
- }
374
- );
375
-
376
- bus.on('mongosh:api-load-file', function (args: ScriptLoadFileEvent) {
377
- log.info(
378
- 'MONGOSH',
379
- mongoLogId(1_000_000_012),
380
- 'shell-api',
381
- 'Loading file via load()',
382
- args
383
- );
384
-
385
- analytics.track({
386
- ...getTelemetryUserIdentity(),
387
- event: hasStartedMongoshRepl ? 'Script Loaded' : 'Script Loaded CLI',
388
- properties: {
389
- ...trackProperties,
390
- nested: args.nested,
391
- ...(hasStartedMongoshRepl ? {} : { shell: usesShellOption }),
392
- },
393
- });
394
- });
395
-
396
- bus.on('mongosh:eval-cli-script', function () {
397
- log.info(
398
- 'MONGOSH',
399
- mongoLogId(1_000_000_013),
400
- 'repl',
401
- 'Evaluating script passed on the command line'
402
- );
403
-
404
- analytics.track({
405
- ...getTelemetryUserIdentity(),
406
- event: 'Script Evaluated',
407
- properties: {
408
- ...trackProperties,
409
- shell: usesShellOption,
410
- },
411
- });
412
- });
413
-
414
- bus.on('mongosh:mongoshrc-load', function () {
415
- log.info(
416
- 'MONGOSH',
417
- mongoLogId(1_000_000_014),
418
- 'repl',
419
- 'Loading .mongoshrc.js'
420
- );
421
-
422
- analytics.track({
423
- ...getTelemetryUserIdentity(),
424
- event: 'Mongoshrc Loaded',
425
- properties: {
426
- ...trackProperties,
427
- },
428
- });
429
- });
430
-
431
- bus.on('mongosh:mongoshrc-mongorc-warn', function () {
432
- log.info(
433
- 'MONGOSH',
434
- mongoLogId(1_000_000_015),
435
- 'repl',
436
- 'Warning about .mongorc.js/.mongoshrc.js mismatch'
437
- );
438
-
439
- analytics.track({
440
- ...getTelemetryUserIdentity(),
441
- event: 'Mongorc Warning',
442
- properties: {
443
- ...trackProperties,
444
- },
445
- });
446
- });
447
-
448
- bus.on(
449
- 'mongosh:crypt-library-load-skip',
450
- function (ev: CryptLibrarySkipEvent) {
451
- log.info(
452
- 'AUTO-ENCRYPTION',
453
- mongoLogId(1_000_000_050),
454
- 'crypt-library',
455
- 'Skipping shared library candidate',
456
- ev
457
- );
458
- }
459
- );
460
-
461
- bus.on(
462
- 'mongosh:crypt-library-load-found',
463
- function (ev: CryptLibraryFoundEvent) {
464
- log.warn(
465
- 'AUTO-ENCRYPTION',
466
- mongoLogId(1_000_000_051),
467
- 'crypt-library',
468
- 'Accepted shared library candidate',
469
- {
470
- cryptSharedLibPath: ev.cryptSharedLibPath,
471
- expectedVersion: ev.expectedVersion.versionStr,
472
- }
473
- );
474
- }
475
- );
476
-
477
- bus.on('mongosh-snippets:loaded', function (ev: SnippetsLoadedEvent) {
478
- log.info(
479
- 'MONGOSH-SNIPPETS',
480
- mongoLogId(1_000_000_019),
481
- 'snippets',
482
- 'Loaded snippets',
483
- ev
484
- );
485
- });
486
-
487
- bus.on('mongosh-snippets:npm-lookup', function (ev: SnippetsNpmLookupEvent) {
488
- log.info(
489
- 'MONGOSH-SNIPPETS',
490
- mongoLogId(1_000_000_020),
491
- 'snippets',
492
- 'Performing npm lookup',
493
- ev
494
- );
495
- });
496
-
497
- bus.on('mongosh-snippets:npm-lookup-stopped', function () {
498
- log.info(
499
- 'MONGOSH-SNIPPETS',
500
- mongoLogId(1_000_000_021),
501
- 'snippets',
502
- 'npm lookup stopped'
503
- );
504
- });
505
-
506
- bus.on(
507
- 'mongosh-snippets:npm-download-failed',
508
- function (ev: SnippetsNpmDownloadFailedEvent) {
509
- log.info(
510
- 'MONGOSH-SNIPPETS',
511
- mongoLogId(1_000_000_022),
512
- 'snippets',
513
- 'npm download failed',
514
- ev
515
- );
516
- }
517
- );
518
-
519
- bus.on(
520
- 'mongosh-snippets:npm-download-active',
521
- function (ev: SnippetsNpmDownloadActiveEvent) {
522
- log.info(
523
- 'MONGOSH-SNIPPETS',
524
- mongoLogId(1_000_000_023),
525
- 'snippets',
526
- 'npm download active',
527
- ev
528
- );
529
- }
530
- );
531
-
532
- bus.on(
533
- 'mongosh-snippets:fetch-index',
534
- function (ev: SnippetsFetchIndexEvent) {
535
- log.info(
536
- 'MONGOSH-SNIPPETS',
537
- mongoLogId(1_000_000_024),
538
- 'snippets',
539
- 'Fetching snippet index',
540
- ev
541
- );
542
- }
543
- );
544
-
545
- bus.on('mongosh-snippets:fetch-cache-invalid', function () {
546
- log.info(
547
- 'MONGOSH-SNIPPETS',
548
- mongoLogId(1_000_000_025),
549
- 'snippets',
550
- 'Snippet cache invalid'
551
- );
552
- });
553
-
554
- bus.on(
555
- 'mongosh-snippets:fetch-index-error',
556
- function (ev: SnippetsFetchIndexErrorEvent) {
557
- log.info(
558
- 'MONGOSH-SNIPPETS',
559
- mongoLogId(1_000_000_026),
560
- 'snippets',
561
- 'Fetching snippet index failed',
562
- ev
563
- );
564
- }
565
- );
566
-
567
- bus.on('mongosh-snippets:fetch-index-done', function () {
568
- log.info(
569
- 'MONGOSH-SNIPPETS',
570
- mongoLogId(1_000_000_027),
571
- 'snippets',
572
- 'Fetching snippet index done'
573
- );
574
- });
575
-
576
- bus.on(
577
- 'mongosh-snippets:package-json-edit-error',
578
- function (ev: SnippetsErrorEvent) {
579
- log.info(
580
- 'MONGOSH-SNIPPETS',
581
- mongoLogId(1_000_000_028),
582
- 'snippets',
583
- 'Modifying snippets package.json failed',
584
- ev
585
- );
586
- }
587
- );
588
-
589
- bus.on('mongosh-snippets:spawn-child', function (ev: SnippetsRunNpmEvent) {
590
- log.info(
591
- 'MONGOSH-SNIPPETS',
592
- mongoLogId(1_000_000_029),
593
- 'snippets',
594
- 'Spawning helper',
595
- ev
596
- );
597
- });
598
-
599
- bus.on(
600
- 'mongosh-snippets:load-snippet',
601
- function (ev: SnippetsLoadSnippetEvent) {
602
- log.info(
603
- 'MONGOSH-SNIPPETS',
604
- mongoLogId(1_000_000_030),
605
- 'snippets',
606
- 'Loading snippet',
607
- ev
608
- );
609
- }
610
- );
611
-
612
- bus.on(
613
- 'mongosh-snippets:snippet-command',
614
- function (ev: SnippetsCommandEvent) {
615
- log.info(
616
- 'MONGOSH-SNIPPETS',
617
- mongoLogId(1_000_000_031),
618
- 'snippets',
619
- 'Running snippet command',
620
- ev
621
- );
622
-
623
- if (ev.args[0] === 'install') {
624
- analytics.track({
625
- ...getTelemetryUserIdentity(),
626
- event: 'Snippet Install',
627
- properties: {
628
- ...trackProperties,
629
- },
630
- });
631
- }
632
- }
633
- );
634
-
635
- bus.on(
636
- 'mongosh-snippets:transform-error',
637
- function (ev: SnippetsTransformErrorEvent) {
638
- log.info(
639
- 'MONGOSH-SNIPPETS',
640
- mongoLogId(1_000_000_032),
641
- 'snippets',
642
- 'Rewrote error message',
643
- ev
644
- );
645
- }
646
- );
647
-
648
- const deprecatedApiCalls = new MultiSet<Pick<ApiEvent, 'class' | 'method'>>();
649
- const apiCalls = new MultiSet<Pick<ApiEvent, 'class' | 'method'>>();
650
- let apiCallTrackingEnabled = false;
651
- bus.on('mongosh:api-call', function (ev: ApiEvent) {
652
- // Only track if we have previously seen a mongosh:evaluate-started call
653
- if (!apiCallTrackingEnabled) return;
654
- if (ev.deprecated) {
655
- deprecatedApiCalls.add({ class: ev.class, method: ev.method });
656
- }
657
- if (ev.callDepth === 0 && ev.isAsync) {
658
- apiCalls.add({ class: ev.class, method: ev.method });
659
- }
660
- });
661
- bus.on('mongosh:evaluate-started', function () {
662
- apiCallTrackingEnabled = true;
663
- // Clear API calls before evaluation starts. This is important because
664
- // some API calls are also emitted by mongosh CLI repl internals,
665
- // but we only care about those emitted from user code (i.e. during
666
- // evaluation).
667
- deprecatedApiCalls.clear();
668
- apiCalls.clear();
669
- });
670
- bus.on('mongosh:evaluate-finished', function () {
671
- for (const [entry] of deprecatedApiCalls) {
672
- log.warn(
673
- 'MONGOSH',
674
- mongoLogId(1_000_000_033),
675
- 'shell-api',
676
- 'Deprecated API call',
677
- entry
678
- );
679
-
680
- analytics.track({
681
- ...getTelemetryUserIdentity(),
682
- event: 'Deprecated Method',
683
- properties: {
684
- ...trackProperties,
685
- ...entry,
686
- },
687
- });
688
- }
689
- for (const [entry, count] of apiCalls) {
690
- analytics.track({
691
- ...getTelemetryUserIdentity(),
692
- event: 'API Call',
693
- properties: {
694
- ...trackProperties,
695
- ...entry,
696
- count,
697
- },
698
- });
699
- }
700
- deprecatedApiCalls.clear();
701
- apiCalls.clear();
702
- apiCallTrackingEnabled = false;
703
- });
704
-
705
- // Log ids 1_000_000_034 through 1_000_000_042 are reserved for the
706
- // devtools-connect package which was split out from mongosh.
707
- // 'mongodb' is not supported in startup snapshots yet.
708
- // eslint-disable-next-line @typescript-eslint/no-var-requires
709
- hookLogger(bus, log, 'mongosh', redactURICredentials);
710
-
711
- bus.on('mongosh-sp:reset-connection-options', function () {
712
- log.info(
713
- 'MONGOSH-SP',
714
- mongoLogId(1_000_000_040),
715
- 'connect',
716
- 'Reconnect because of changed connection options'
717
- );
718
- });
719
-
720
- bus.on(
721
- 'mongosh-editor:run-edit-command',
722
- function (ev: EditorRunEditCommandEvent) {
723
- log.error(
724
- 'MONGOSH-EDITOR',
725
- mongoLogId(1_000_000_047),
726
- 'editor',
727
- 'Open external editor',
728
- redactInfo(ev)
729
- );
730
- }
731
- );
732
-
733
- bus.on(
734
- 'mongosh-editor:read-vscode-extensions-done',
735
- function (ev: EditorReadVscodeExtensionsDoneEvent) {
736
- log.error(
737
- 'MONGOSH-EDITOR',
738
- mongoLogId(1_000_000_043),
739
- 'editor',
740
- 'Reading vscode extensions from file system succeeded',
741
- ev
742
- );
743
- }
744
- );
745
-
746
- bus.on(
747
- 'mongosh-editor:read-vscode-extensions-failed',
748
- function (ev: EditorReadVscodeExtensionsFailedEvent) {
749
- log.error(
750
- 'MONGOSH-EDITOR',
751
- mongoLogId(1_000_000_044),
752
- 'editor',
753
- 'Reading vscode extensions from file system failed',
754
- {
755
- ...ev,
756
- error: ev.error.message,
757
- }
758
- );
759
- }
760
- );
761
-
762
- bus.on(
763
- 'mongosh:fetching-update-metadata',
764
- function (ev: FetchingUpdateMetadataEvent) {
765
- log.info(
766
- 'MONGOSH',
767
- mongoLogId(1_000_000_052),
768
- 'startup',
769
- 'Fetching update metadata',
770
- {
771
- ...ev,
772
- }
773
- );
774
- }
775
- );
776
-
777
- bus.on(
778
- 'mongosh:fetching-update-metadata-complete',
779
- function (ev: FetchingUpdateMetadataCompleteEvent) {
780
- log.info(
781
- 'MONGOSH',
782
- mongoLogId(1_000_000_053),
783
- 'startup',
784
- 'Fetching update metadata complete',
785
- {
786
- ...ev,
787
- }
788
- );
789
- }
790
- );
791
-
792
- // NB: mongoLogId(1_000_000_045) is used in cli-repl itself
793
- // NB: mongoLogId(1_000_000_034) through mongoLogId(1_000_000_042) are used in devtools-connect
794
- // NB: mongoLogId(1_000_000_049) is used in devtools-connect
795
- }