You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Gremlin-JavaScript driver emits connection events for logging and monitoring, but these events are silently ignored unless a listener is attached. Use the `addListener()` method to subscribe to events after creating a `DriverRemoteConnection` or `Client`:
1604
+
1605
+
[source,javascript]
1606
+
----
1607
+
// Using DriverRemoteConnection
1608
+
const dc = new DriverRemoteConnection('ws://localhost:8182/gremlin');
1609
+
1610
+
dc.addListener('log', (message) => {
1611
+
console.log('[Gremlin Log]', message);
1612
+
});
1613
+
1614
+
dc.addListener('socketError', (err) => {
1615
+
console.error('[Gremlin Error]', err);
1616
+
});
1617
+
1618
+
dc.addListener('close', (code, message) => {
1619
+
console.warn('[Gremlin Close]', code, message);
1620
+
});
1621
+
1622
+
const g = traversal().withRemote(dc);
1623
+
1624
+
// Using Client
1625
+
const client = new Client('ws://localhost:8182/gremlin', { traversalSource: 'g' });
0 commit comments