• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

visgl / deck.gl / 22247270512

21 Feb 2026 01:06AM UTC coverage: 91.059% (-0.003%) from 91.062%
22247270512

push

github

web-flow
chore: bump probe.gl (#10025)

6916 of 7610 branches covered (90.88%)

Branch coverage included in aggregate %.

57029 of 62614 relevant lines covered (91.08%)

14329.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.41
/modules/core/src/debug/loggers.ts
1
// deck.gl
1✔
2
// SPDX-License-Identifier: MIT
1✔
3
// Copyright (c) vis.gl contributors
1✔
4

1✔
5
import type {Log} from '@probe.gl/log';
1✔
6

1✔
7
const logState: {
1✔
8
  attributeUpdateStart: number;
1✔
9
  attributeManagerUpdateStart: number;
1✔
10
  attributeUpdateMessages: string[];
1✔
11
} = {
1✔
12
  attributeUpdateStart: -1,
1✔
13
  attributeManagerUpdateStart: -1,
1✔
14
  attributeUpdateMessages: []
1✔
15
};
1✔
16

1✔
17
const LOG_LEVEL_MAJOR_UPDATE = 1; // Events with direct perf impact
1✔
18
const LOG_LEVEL_MINOR_UPDATE = 2; // Events that may affect perf
1✔
19
const LOG_LEVEL_UPDATE_DETAIL = 3;
1✔
20
const LOG_LEVEL_INFO = 4;
1✔
21
const LOG_LEVEL_DRAW = 2;
1✔
22

1✔
23
export const getLoggers = (log: Log): Record<string, Function> => ({
1✔
24
  /* Layer events */
1✔
25

1✔
26
  'layer.changeFlag': (layer, key, flags) => {
1✔
27
    log.log(LOG_LEVEL_UPDATE_DETAIL, `${layer.id} ${key}: `, flags[key])();
5✔
28
  },
5✔
29

1✔
30
  'layer.initialize': layer => {
1✔
31
    log.log(LOG_LEVEL_MAJOR_UPDATE, `Initializing ${layer}`)();
1✔
32
  },
1✔
33
  'layer.update': (layer, needsUpdate) => {
1✔
34
    if (needsUpdate) {
2✔
35
      const flags = layer.getChangeFlags();
1✔
36
      log.log(
1✔
37
        LOG_LEVEL_MINOR_UPDATE,
1✔
38
        `Updating ${layer} because: ${Object.keys(flags)
1✔
39
          .filter(key => flags[key])
1✔
40
          .join(', ')}`
1✔
41
      )();
1✔
42
    } else {
1✔
43
      log.log(LOG_LEVEL_INFO, `${layer} does not need update`)();
1✔
44
    }
1✔
45
  },
2✔
46
  'layer.matched': (layer, changed) => {
1✔
47
    if (changed) {
×
48
      log.log(LOG_LEVEL_INFO, `Matched ${layer}, state transfered`)();
×
49
    }
×
50
  },
×
51
  'layer.finalize': layer => {
1✔
52
    log.log(LOG_LEVEL_MAJOR_UPDATE, `Finalizing ${layer}`)();
1✔
53
  },
1✔
54

1✔
55
  /* CompositeLayer events */
1✔
56

1✔
57
  'compositeLayer.renderLayers': (layer, updated, subLayers) => {
1✔
58
    if (updated) {
×
59
      log.log(
×
60
        LOG_LEVEL_MINOR_UPDATE,
×
61
        `Composite layer rendered new subLayers ${layer}`,
×
62
        subLayers
×
63
      )();
×
64
    } else {
×
65
      log.log(LOG_LEVEL_INFO, `Composite layer reused subLayers ${layer}`, subLayers)();
×
66
    }
×
67
  },
×
68

1✔
69
  /* LayerManager events */
1✔
70

1✔
71
  'layerManager.setLayers': (layerManager, updated, layers) => {
1✔
72
    if (updated) {
1✔
73
      log.log(LOG_LEVEL_MINOR_UPDATE, `Updating ${layers.length} deck layers`)();
1✔
74
    }
1✔
75
  },
1✔
76

1✔
77
  'layerManager.activateViewport': (layerManager, viewport) => {
1✔
78
    log.log(LOG_LEVEL_UPDATE_DETAIL, 'Viewport changed', viewport)();
8✔
79
  },
8✔
80

1✔
81
  /* AttributeManager events */
1✔
82

1✔
83
  'attributeManager.invalidate': (attributeManager, trigger, attributeNames) => {
1✔
84
    log.log(
2✔
85
      LOG_LEVEL_MAJOR_UPDATE,
2✔
86
      attributeNames
2!
87
        ? `invalidated attributes ${attributeNames} (${trigger}) for ${attributeManager.id}`
×
88
        : `invalidated all attributes for ${attributeManager.id}`
2✔
89
    )();
2✔
90
  },
2✔
91

1✔
92
  'attributeManager.updateStart': attributeManager => {
1✔
93
    logState.attributeUpdateMessages.length = 0;
1✔
94
    logState.attributeManagerUpdateStart = Date.now();
1✔
95
  },
1✔
96
  'attributeManager.updateEnd': (attributeManager, numInstances) => {
1✔
97
    const timeMs = Math.round(Date.now() - logState.attributeManagerUpdateStart);
1✔
98
    log.groupCollapsed(
1✔
99
      LOG_LEVEL_MINOR_UPDATE,
1✔
100
      `Updated attributes for ${numInstances} instances in ${attributeManager.id} in ${timeMs}ms`
1✔
101
    )();
1✔
102
    for (const updateMessage of logState.attributeUpdateMessages) {
1✔
103
      log.log(LOG_LEVEL_UPDATE_DETAIL, updateMessage)();
3✔
104
    }
3✔
105
    log.groupEnd(LOG_LEVEL_MINOR_UPDATE)();
1✔
106
  },
1✔
107

1✔
108
  /* Attribute events */
1✔
109

1✔
110
  'attribute.updateStart': attribute => {
1✔
111
    logState.attributeUpdateStart = Date.now();
2✔
112
  },
2✔
113
  'attribute.allocate': (attribute, numInstances) => {
1✔
114
    const message = `${attribute.id} allocated ${numInstances}`;
1✔
115
    logState.attributeUpdateMessages.push(message);
1✔
116
  },
1✔
117
  'attribute.updateEnd': (attribute, numInstances) => {
1✔
118
    const timeMs = Math.round(Date.now() - logState.attributeUpdateStart);
2✔
119
    const message = `${attribute.id} updated ${numInstances} in ${timeMs}ms`;
2✔
120
    logState.attributeUpdateMessages.push(message);
2✔
121
  },
2✔
122

1✔
123
  /* Render events */
1✔
124

1✔
125
  'deckRenderer.renderLayers': (deckRenderer, renderStats, opts) => {
1✔
126
    const {pass, redrawReason, stats} = opts;
1✔
127
    for (const status of renderStats) {
1✔
128
      const {totalCount, visibleCount, compositeCount, pickableCount} = status;
1✔
129
      const primitiveCount = totalCount - compositeCount;
1✔
130
      const hiddenCount = primitiveCount - visibleCount;
1✔
131

1✔
132
      log.log(
1✔
133
        LOG_LEVEL_DRAW,
1✔
134
        `RENDER #${deckRenderer.renderCount} \
1✔
135
  ${visibleCount} (of ${totalCount} layers) to ${pass} because ${redrawReason} \
1✔
136
  (${hiddenCount} hidden, ${compositeCount} composite ${pickableCount} pickable)`
1✔
137
      )();
1✔
138

1✔
139
      if (stats) {
1!
140
        stats.get('Redraw Layers').add(visibleCount);
×
141
      }
×
142
    }
1✔
143
  }
1✔
144
});
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc